Toggle All Todos Between Completed and Not Completed
Story: As a user, I want to be able to toggle all todos between completed and not completed statuses.
MainSection actions
It should create an action to toggle all todos between completed and not completed
diff --git a/tests/todomvc/actions.spec.js b/tests/todomvc/actions.spec.js
index 367d6ad..2ae2dec 100644
--- a/tests/todomvc/actions.spec.js
+++ b/tests/todomvc/actions.spec.js
@@ -37,5 +37,13 @@ describe('TodoMVC actions', () => {
};
expect(todomvc.actions.toggleCompleteOneTodo('my_id')).to.deep.equal(expectedAction)
+ });
+
+ it('Should create an action to toggle all todos between completed and not completed', () => {
+ const expectedAction = {
+ type: todomvc.types.TOGGLE_COMPLETE_ALL, all_completed: true
+ };
+
+ expect(todomvc.actions.toggleCompleteAllTodos()).to.deep.equal(expectedAction)
})
});
(END)TodoMVC reducer
It should handle TOGGLE_COMPLETE_ALL todo
Header component
It should render correctly
It should have a toggle all complete status checkbox
It should behave correctly
It should call toggleCompleteAllTodos() when the complete all status checkbox is changed
Run It!

PreviousToggle a Todo Between Completed and Not CompletedNextSee the Number of Todos To Be Completed
Last updated
Was this helpful?