Skip to content

Commit fb01341

Browse files
committed
Add test to verify deletion of completed tasks results in an empty array
1 parent 36b055f commit fb01341

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎Sprint-3/todo-list/todos.test.mjs‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,14 @@ describe("deleteCompleted()", () => {
143143
expect(todos[0]).toEqual(before[1]);
144144
expect(todos[1]).toEqual(before[3]);
145145
});
146+
147+
test("Keeps the remaining tasks in their original order", () => {
148+
const todos = [
149+
{ task: "A", completed: true },
150+
{ task: "B", completed: true },
151+
];
152+
Todos.deleteCompleted(todos);
153+
154+
expect(todos).toEqual([]);
155+
});
146156
});

0 commit comments

Comments
 (0)