Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Commit

Permalink
Add missing ShowIf test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Martinez committed Jul 4, 2017
1 parent 4183443 commit 83d6eb4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/javascript/components/ShowIf.test.js
Expand Up @@ -9,6 +9,11 @@ test('renders correctly', () => {
expect(toJson(wrapper)).toMatchSnapshot();
});

test('renders null if passed with no children', () => {
const wrapper = shallow(<ShowIf condition={true} />);
expect(toJson(wrapper)).toMatchSnapshot();
});

test('it has visible class when condition is truthy', () => {
const wrapper = shallow(<ShowIf condition={true}>Hello</ShowIf>);
expect(wrapper.hasClass('ShowIf--visible')).toBeTruthy();
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/components/__snapshots__/ShowIf.test.js.snap
Expand Up @@ -7,3 +7,5 @@ exports[`renders correctly 1`] = `
Content
</div>
`;

exports[`renders null if passed with no children 1`] = `null`;

0 comments on commit 83d6eb4

Please sign in to comment.