Repository navigation
London | 26-ITP-Sep | Mahir Shah | Sprint 3 | Todo list - #1567
MahirShah300 wants to merge 7 commits into
Conversation
| test("Delete all completed tasks", () => { | ||
| const todos = createMockTodos(); | ||
| const todosBeforeDeletion = createMockTodos(); | ||
| const lengthBeforeDeletion = todos.length; | ||
| Todos.deleteCompletedTasks(todos); | ||
|
|
||
| expect(todos).toHaveLength(lengthBeforeDeletion - 2); | ||
|
|
||
| expect(todos[0]).toEqual(todosBeforeDeletion[1]); | ||
| expect(todos[1]).toEqual(todosBeforeDeletion[3]); | ||
| }); |
There was a problem hiding this comment.
When this test fails, what suite name will Jest report based on its surrounding describe block?
To "like" or "dislike" this comment, please follow this link
There was a problem hiding this comment.
deleteTask(). I should move it outside the describe block because it isn't testing deleteTask().
| <div class="todo-input"> | ||
| <input type="text" id="new-task-input" placeholder="Enter a new task..." /> | ||
| <button id="add-task-btn">Add</button> | ||
| <button id="delete-completed-tasks-btn" style = "background-color: red" ;>Delete Completed Tasks</button> |
There was a problem hiding this comment.
What does the semicolon after the quoted style value become when the browser parses this button element?
To "like" or "dislike" this comment, please follow this link
There was a problem hiding this comment.
An empty attribute. the semicolon should be inside the quotes
|
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. |
…ed to use new function name
…s-btn inside the quotes
hackertainment
left a comment
There was a problem hiding this comment.
The coding logic generally looks good. Just one issue to fix. Please keep it up. Thank you.
| document | ||
| .getElementById("delete-completed-tasks-btn") | ||
| .addEventListener("click", () => { | ||
| Todos.deleteCompletedTasks(todos); |
There was a problem hiding this comment.
Uncaught ReferenceError: the function is not defined. If you run this in your browser without such error, then try to clear the cache first. Please fix it, thank you.
Learners, PR Template
Self checklist
Task code
CYF-1097
Changelist
Implemented delete all completed tasks function, button and tests