Skip to content

Commit

Permalink
reactions.jsx: Add snapshot test
Browse files Browse the repository at this point in the history
Related to #129
  • Loading branch information
li-boxuan committed Aug 3, 2018
1 parent 59e9cba commit 8a3c49b
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
54 changes: 54 additions & 0 deletions test/src/components/__snapshots__/reactions.test.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`does not display number zero 1`] = `
Array [
<button
className="btn btn-xs btn-default"
disabled={false}
type="button"
>
πŸ‘
</button>,
<button
className="btn btn-xs btn-default"
disabled={false}
type="button"
>
πŸ‘Ž
</button>,
<button
className="btn btn-xs btn-default"
disabled={false}
type="button"
>
πŸ˜„
</button>,
<button
className="btn btn-xs btn-default"
disabled={false}
type="button"
>
πŸŽ‰
</button>,
<button
className="btn btn-xs btn-default"
disabled={false}
type="button"
>
πŸ˜•
</button>,
<button
className="btn btn-xs btn-default"
disabled={false}
type="button"
>
❀️
</button>,
]
`;
17 changes: 17 additions & 0 deletions test/src/components/reactions.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import renderer from 'react-test-renderer';
import Reactions from '../../../src/components/reactions';

it('does not display number zero', () => {
const stat = {
THUMBS_UP: 0,
THUMBS_DOWN: 0,
LAUGH: 0,
HOORAY: 0,
CONFUSED: 0,
HEART: 0,
};
const rendered = renderer.create(
<Reactions stat={stat} />
);
expect(rendered.toJSON()).toMatchSnapshot();
});

0 comments on commit 8a3c49b

Please sign in to comment.