Filter the Todos List Between Completed, Not Completed, and All
Story: As a user, I want to be able to filter All, Active, and Completed todos.
MainSection component
Should render correctly
It should include a completed radio-button filter
diff --git a/tests/todomvc/components/MainSection.spec.js b/tests/todomvc/components/MainSection.spec.js
index 9ffc1de..259b510 100644
--- a/tests/todomvc/components/MainSection.spec.js
+++ b/tests/todomvc/components/MainSection.spec.js
@@ -59,6 +59,18 @@ describe('MainSection component', () => {
const footer = component.children('Footer');
expect(footer).to.have.length(1);
+ });
+
+ it('Should include a completed radio-button filter', () => {
+ const {component} = setup();
+ const radio_buttons = component.children('input');
+
+ expect(radio_buttons).to.have.length(3);
+ radio_buttons.map(radio_button => expect(radio_button.props().type).to.equal('radio'));
+ radio_buttons.map(radio_button => expect(radio_button.props().name).to.equal('complete_status'));
+ expect(radio_buttons.nodes[0].props.value).to.equal('show_all');
+ expect(radio_buttons.nodes[1].props.value).to.equal('show_completed');
+ expect(radio_buttons.nodes[2].props.value).to.equal('show_not_completed')
})
})
});
(END)Should behave correctly
It should show the filtered list of Todos
Run It!




Last updated
Was this helpful?