Permalink
Browse files

Add storyshots and use to run snapshot tests for stories

  • Loading branch information...
tmeasday committed Mar 26, 2018
1 parent 40ca943 commit b3488c2713733deb31101792d20f723be885b04c
Showing with 236 additions and 4 deletions.
  1. +4 −2 package.json
  2. +122 −0 src/__snapshots__/storybook.test.js.snap
  3. +2 −0 src/storybook.test.js
  4. +108 −2 yarn.lock
@@ -6,16 +6,18 @@
"react": "^16.2.0",
"react-dom": "^16.2.0"},
"devDependencies": {
"@storybook/react": "^3.3.15",
"@storybook/addon-actions": "^3.3.15",
"@storybook/addon-links": "^3.3.15",
"@storybook/addon-storyshots": "^3.3.15",
"@storybook/addons": "^3.3.15",
"@storybook/react": "^3.3.15",
"babel-core": "^6.26.0",
"grunt": "^1.0.1",
"grunt-contrib-less": "^1.4.0",
"grunt-contrib-watch": "^1.0.0",
"less": "^2.7.1",
"react-scripts": "1.1.1"
"react-scripts": "1.1.1",
"react-test-renderer": "^16.2.0"
},
"scripts": {
"build-css": "lessc src/style/index.less src/index.css",
@@ -0,0 +1,122 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Storyshots Task archived 1`] = `
<div
className="list-item TASK_ARCHIVED"
>
<label
className="checkbox"
>
<input
defaultChecked={true}
disabled={true}
name="checked"
type="checkbox"
/>
<span
className="checkbox-custom"
onClick={[Function]}
/>
</label>
<div
className="title"
>
<input
placeholder="Input title"
readOnly={true}
type="text"
value="Test Task"
/>
</div>
<div
className="actions"
onClick={[Function]}
/>
</div>
`;

exports[`Storyshots Task default 1`] = `
<div
className="list-item TASK_INBOX"
>
<label
className="checkbox"
>
<input
defaultChecked={false}
disabled={true}
name="checked"
type="checkbox"
/>
<span
className="checkbox-custom"
onClick={[Function]}
/>
</label>
<div
className="title"
>
<input
placeholder="Input title"
readOnly={true}
type="text"
value="Test Task"
/>
</div>
<div
className="actions"
onClick={[Function]}
>
<a
onClick={[Function]}
>
<span
className="icon-star"
/>
</a>
</div>
</div>
`;

exports[`Storyshots Task pinned 1`] = `
<div
className="list-item TASK_PINNED"
>
<label
className="checkbox"
>
<input
defaultChecked={false}
disabled={true}
name="checked"
type="checkbox"
/>
<span
className="checkbox-custom"
onClick={[Function]}
/>
</label>
<div
className="title"
>
<input
placeholder="Input title"
readOnly={true}
type="text"
value="Test Task"
/>
</div>
<div
className="actions"
onClick={[Function]}
>
<a
onClick={[Function]}
>
<span
className="icon-star"
/>
</a>
</div>
</div>
`;
@@ -0,0 +1,2 @@
import initStoryshots from '@storybook/addon-storyshots';
initStoryshots();
110 yarn.lock

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit b3488c2

Please sign in to comment.