Repository navigation
Manchester | 26-ITP-Sept | Aklilu Mihtsun | Sprint 3 | Build a todo-list app - #1581
AkliluMihtsun wants to merge 7 commits into
Conversation
…ng all completed tasks
This comment has been minimized.
This comment has been minimized.
| expect(todos[0]).toEqual(todosBeforeDeletionCompleted[1]); | ||
| expect(todos[1]).toEqual(todosBeforeDeletionCompleted[3]); |
There was a problem hiding this comment.
After deleting the completed tasks, what assertion confirms there are no extra entries beyond the two expected tasks?
To "like" or "dislike" this comment, please follow this link
| export function toggleCompletedOnTask(todos, taskIndex) { | ||
| if (todos[taskIndex]) { | ||
| todos[taskIndex].completed = !todos[taskIndex].completed; | ||
| todos[taskIndex].completed = !todos[taskIndex].completed; // changes false to true |
There was a problem hiding this comment.
How does this comment describe the case where completed is already true?
To "like" or "dislike" this comment, please follow this link
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
hackertainment
left a comment
There was a problem hiding this comment.
The code generally looks ok to me. Just need to add two more test cases to increase testing coverage. Thank you.
| test("Delete all completed tasks", () => { | ||
| const todos = createMockTodos(); | ||
| const todosBeforeDeletionCompleted = createMockTodos(); | ||
| Todos.deleteCompleted(todos); | ||
| expect(todos).toHaveLength(2); | ||
| expect(todos[0]).toEqual(todosBeforeDeletionCompleted[1]); | ||
| expect(todos[1]).toEqual(todosBeforeDeletionCompleted[3]); | ||
| }); |
There was a problem hiding this comment.
This test case is correct. How about when all tasks are completed or when all tasks incomplete? Please add these two two cases as well. Thank you.
Learners, PR Template
Self checklist
Task code
CYF-1097
Changelist
I have added the button to delete the completed tasks, and I have tested it