Toggle a Todo Between Completed and Not Completed
Story: As a user, I want to be able to toggle a todo between completed and not completed statuses, so that I can keep track of it.
TodoMVC actions
It should create an action to toggle a todo between completed and not completed
diff --git a/tests/todomvc/actions.spec.js b/tests/todomvc/actions.spec.js
index fd31f8f..367d6ad 100644
--- a/tests/todomvc/actions.spec.js
+++ b/tests/todomvc/actions.spec.js
@@ -29,5 +29,13 @@ describe('TodoMVC actions', () => {
};
expect(todomvc.actions.deleteTodo('my_id')).to.deep.equal(expectedAction)
+ });
+
+ it('Should create an action to toggle a todo between completed and not completed', () => {
+ const expectedAction = {
+ type: todomvc.types.TOGGLE_COMPLETE_ONE, id: 'my_id'
+ };
+
+ expect(todomvc.actions.toggleCompleteOneTodo('my_id')).to.deep.equal(expectedAction)
})
});
(END)TodoMVC reducer
It should handle TOGGLE_COMPLETE_ONE todo
TodoItem component
It Should render correctly
It should have a toggle complete status checkbox
It should behave correctly
It should call toggleCompleteOneTodo() when the complete status checkbox is changed
Run It!

Last updated
Was this helpful?