Skip to content

London | 26-ITP-Sep | Shirin Panahian| Sprint 3 | Build a todo-list app - #1572

Open
shirinpanahian wants to merge 3 commits into
CodeYourFuture:mainfrom
shirinpanahian:feat/todo-list-clean
Open

shirinpanahian wants to merge 3 commits into
CodeYourFuture:mainfrom
shirinpanahian:feat/todo-list-clean

Conversation

@shirinpanahian

Copy link
Copy Markdown

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Task code

CYF-1097

Changelist

  • Implemented deleteCompleted() to remove all completed tasks.
  • Added a click event listener to the Delete Completed button.
  • Updated the todo list display after deleting completed tasks.
  • Added and updated tests for the functionality.

@shirinpanahian shirinpanahian added 📅 Sprint 3 Assigned during Sprint 3 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Nov 21, 2026
Comment thread Sprint-3/todo-list/todos.test.mjs Outdated
Comment on lines +53 to +54
Todos.deleteCompleted(todos);
expect(todos).toHaveLength(lengthBeforeDeletion - lengthOfCompletedTask);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would this length-only assertion report if deleteCompleted removed the same number of incomplete tasks instead?

To "like" or "dislike" this comment, please follow this link

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! The test only checked the number of remaining todos, not whether the correct todos were deleted. I've updated the assertion to verify that completed todos are removed and incomplete todos remain.

Comment thread Sprint-3/todo-list/script.mjs Outdated
Comment on lines +18 to +19
// In `script.js`, call `deleteCompleted()` whenever the new button is clicked.
// - ⚠️ You should not need to modify the `render()` function.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The page loads this module as script.mjs; how does the script.js reference in this instruction line up with the file being edited?

To "like" or "dislike" this comment, please follow this link

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! The page loads script.mjs, so I removed the incorrect script.js reference from the instructions.

@cyf-ai-code-reviewer cyf-ai-code-reviewer Bot added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Nov 21, 2026
@cyf-ai-code-reviewer

Copy link
Copy Markdown

The CYF AI review has left comments. It will only review a PR one time. When you have addressed these comments, please request review again and a volunteer will take a look.

@shirinpanahian shirinpanahian added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 📅 Sprint 3 Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant