Delete All Completed Todos From the List
Story: As a user, I want to be able to delete all completed todos from my todos list.
TodoMVC actions
It should create an action to delete all completed todos
diff --git a/tests/todomvc/actions.spec.js b/tests/todomvc/actions.spec.js
index 2ae2dec..6ac3464 100644
--- a/tests/todomvc/actions.spec.js
+++ b/tests/todomvc/actions.spec.js
@@ -45,5 +45,13 @@ describe('TodoMVC actions', () => {
};
expect(todomvc.actions.toggleCompleteAllTodos()).to.deep.equal(expectedAction)
+ });
+
+ it('Should create an action to delete all completed todos', () => {
+ const expectedAction = {
+ type: todomvc.types.DELETE_COMPLETED
+ };
+
+ expect(todomvc.actions.deleteCompletedTodos()).to.deep.equal(expectedAction)
})
});
(END)TodoMVC reducer
It should handle DELETE_COMPLETED todo
Footer component
It should render correctly
It should have a 'delete completed' button
It should behave correctly
It should not show 'delete completed' button when there are no completed todos
Should call deleteCompletedTodos() when the delete completed button is clicked
Run It!



PreviousFilter the Todos List Between Completed, Not Completed, and AllNextStyling TodoMVC Application
Last updated
Was this helpful?