| | |
| | | },{ |
| | | completed: false, |
| | | title: "easy testing is fun" |
| | | }] |
| | | }]; |
| | | const importantTodos = [{ |
| | | completed: true, |
| | | title: "testing sucks", |
| | | important: true |
| | | }] |
| | | |
| | | describe("Mutation tests", () => { |
| | | beforeEach(() => { |
| | |
| | | mutations.MARK_TODO_COMPLETED(state, 0); |
| | | expect(state.todos[0].completed).toBe(true); |
| | | }); |
| | | |
| | | it("it should MARK_TODO_IMPORTANT as false", () => { |
| | | state.todos = importantTodos; |
| | | mutations.MARK_TODO_IMPORTANT(state, 0); |
| | | expect(state.todos[0].important).toBe(false); |
| | | }); |
| | | |
| | | it("it should MARK_TODO_IMPORTANT as true", () => { |
| | | state.todos = importantTodos; |
| | | state.todos[0].important = false; |
| | | mutations.MARK_TODO_IMPORTANT(state, 0); |
| | | expect(state.todos[0].important).toBe(true); |
| | | }); |
| | | }); |