Skip to content

Commit

Permalink
fixup! Add React Storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Scarrott committed Oct 11, 2016
1 parent a41e7c1 commit 5eed20a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/components/lib/button/Button.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* eslint-env jasmine */

import React from 'react';
import renderer from 'react-test-renderer';
import Button from 'components/lib/button/Button';

describe('components/lib/button/Button', () => {

it('renders correctly', () => {
const component = renderer.create(
<Button onClick={() => {}}>
Hello Button.
</Button>
);
const tree = component.toJSON();
expect(tree).toMatchSnapshot();
});

});
7 changes: 7 additions & 0 deletions src/components/lib/button/__snapshots__/Button.test.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
exports[`components/lib/button/Button renders correctly 1`] = `
<button
className="root"
onClick={[Function]}>
Hello Button.
</button>
`;
1 change: 1 addition & 0 deletions src/stories/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'css-reset';
import React from 'react';
import { storiesOf, action } from '@kadira/storybook';
import Button from 'components/lib/button/Button';
Expand Down

0 comments on commit 5eed20a

Please sign in to comment.