Skip to content

Commit 71aac32

Browse files
Wrote a test to pass Deadline feature
1 parent 85a63c8 commit 71aac32

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,13 @@ function createMockTodos() {
1818
}
1919

2020
// A mock task to simulate user input
21-
const theTask = { task: "The Task", completed: false };
21+
const theTask = { task: "The Task", completed: false, deadline: null };
2222

2323
describe("addTask()", () => {
2424
test("Add a task to an empty ToDo list", () => {
2525
let todos = [];
26-
Todos.addTask(todos, theTask.task, theTask.completed);
27-
expect(todos).toHaveLength(1);
28-
expect(todos[0]).toEqual(theTask);
26+
Todos.addTask(todos, theTask.task, theTask.completed);
27+
expect(todos[todos.length - 1]).toEqual(theTask);
2928
});
3029

3130
test("Should append a new task to the end of a ToDo list", () => {

0 commit comments

Comments
 (0)