Delete a Todo
Story: As a user, I want to delete a todo from my todos list.
TodoMVC actions
It should create an action to delete a todo
diff --git a/tests/todomvc/actions.spec.js b/tests/todomvc/actions.spec.js
index 694dd04..fd31f8f 100644
--- a/tests/todomvc/actions.spec.js
+++ b/tests/todomvc/actions.spec.js
@@ -21,5 +21,13 @@ describe('TodoMVC actions', () => {
};
expect(todomvc.actions.editTodo('my_id', description)).to.deep.equal(expectedAction)
+ });
+
+ it('Should create an action to delete a todo', () => {
+ const expectedAction = {
+ type: todomvc.types.DELETE, id: 'my_id'
+ };
+
+ expect(todomvc.actions.deleteTodo('my_id')).to.deep.equal(expectedAction)
})
});
(END)TodoMVC reducer
It should handle DELETE todo
TodoItem component
It Should render correctly
It should have a delete button
It Should behave correctly
Should call deleteTodo() when the delete button is clicked
Should call deleteTodo() when TodoTextInput onSave is called with no text
Run It!

Last updated
Was this helpful?