See Styled Header Component
Story: As a user, I want my Header component to be styled.
Should be styled correctly
It should have header styling applied in accordance with the design specs
Write the test.
diff --git a/tests/todomvc/components/Header.spec.js b/tests/todomvc/components/Header.spec.js
index c340f53..1d65e89 100644
--- a/tests/todomvc/components/Header.spec.js
+++ b/tests/todomvc/components/Header.spec.js
@@ -79,5 +79,13 @@ describe('Header component', () => {
input.simulate('change');
expect(props.actions.toggleCompleteAllTodos.called).to.be.true
})
+ });
+
+ describe('Should be styled correctly', () => {
+ it('Should have header styling applied in accordance with the design specs', () => {
+ const {component} = setup();
+
+ expect(component.find({style: {height: 110}})).to.have.length(1);
+ })
})
});
(END)Run the test and watch it fail.
Write the code to make the test pass.
Run the test and watch it pass.
Commit changes.
It should have h1 styling applied in accordance with the design specs
Write the test.
Run the test and watch it fail.
Write the code to make the test pass.
Run the test and watch it pass.
Commit changes.
It should have checkbox styling applied in accordance with the design specs
Write the test.
Run the test and watch it fail.
Write the code to make the test pass.
Run the test and watch it pass.
Commit changes.
In order to be able to style the text following the checkbox, let's wrap it in span tag.
Should render correctly
It should have a toggle all complete status span
Write the test.
Run the test and watch it fail.
Write the code to make the test pass.
Run the test and watch it pass.
Commit changes.
Should be styled correctly
It should have span styling applied in accordance with the design specs
Write the test.
Run the test and watch it fail.
Write the code to make the test pass.
Run the test and watch it pass.
Commit changes.
Last updated
Was this helpful?