-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a noMatchSnapshots
option.
#917
Closed
tmeasday
wants to merge
4
commits into
storybookjs:master
from
tmeasday:storyshots-no-match-snapshots
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": "react-app" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
177 changes: 177 additions & 0 deletions
177
examples/cra-storybook/src/__snapshots__/storyshots.test.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,177 @@ | ||
exports[`Storyshots Button with some emoji 1`] = ` | ||
<button | ||
onClick={[Function]} | ||
style={ | ||
Object { | ||
"backgroundColor": "#FFFFFF", | ||
"border": "1px solid #eee", | ||
"borderRadius": 3, | ||
"cursor": "pointer", | ||
"fontSize": 15, | ||
"margin": 10, | ||
"padding": "3px 10px", | ||
} | ||
}> | ||
😀 😎 👍 💯 | ||
</button> | ||
`; | ||
|
||
exports[`Storyshots Button with text 1`] = ` | ||
<button | ||
onClick={[Function]} | ||
style={ | ||
Object { | ||
"backgroundColor": "#FFFFFF", | ||
"border": "1px solid #eee", | ||
"borderRadius": 3, | ||
"cursor": "pointer", | ||
"fontSize": 15, | ||
"margin": 10, | ||
"padding": "3px 10px", | ||
} | ||
}> | ||
Hello Button | ||
</button> | ||
`; | ||
|
||
exports[`Storyshots Welcome to Storybook 1`] = ` | ||
<div | ||
style={ | ||
Object { | ||
"fontFamily": "\"Helvetica Neue\", Helvetica, \"Segoe UI\", Arial, freesans, sans-serif", | ||
"lineHeight": 1.4, | ||
"margin": 15, | ||
"maxWidth": 600, | ||
} | ||
}> | ||
<h1> | ||
Welcome to STORYBOOK | ||
</h1> | ||
<p> | ||
This is a UI component dev environment for your app. | ||
</p> | ||
<p> | ||
We\'ve added some basic stories inside the | ||
|
||
<code | ||
style={ | ||
Object { | ||
"backgroundColor": "#f3f2f2", | ||
"border": "1px solid #eae9e9", | ||
"borderRadius": 4, | ||
"color": "#3a3a3a", | ||
"fontSize": 15, | ||
"fontWeight": 600, | ||
"padding": "2px 5px", | ||
} | ||
}> | ||
src/stories | ||
</code> | ||
|
||
directory. | ||
<br /> | ||
A story is a single state of one or more UI components. You can have as many stories as you want. | ||
<br /> | ||
(Basically a story is like a visual test case.) | ||
</p> | ||
<p> | ||
See these sample | ||
|
||
<a | ||
href="#" | ||
onClick={[Function]} | ||
style={ | ||
Object { | ||
"borderBottom": "1px solid #1474f3", | ||
"color": "#1474f3", | ||
"paddingBottom": 2, | ||
"textDecoration": "none", | ||
} | ||
}> | ||
stories | ||
</a> | ||
|
||
for a component called | ||
|
||
<code | ||
style={ | ||
Object { | ||
"backgroundColor": "#f3f2f2", | ||
"border": "1px solid #eae9e9", | ||
"borderRadius": 4, | ||
"color": "#3a3a3a", | ||
"fontSize": 15, | ||
"fontWeight": 600, | ||
"padding": "2px 5px", | ||
} | ||
}> | ||
Button | ||
</code> | ||
. | ||
</p> | ||
<p> | ||
Just like that, you can add your own components as stories. | ||
<br /> | ||
Here\'s how to add your | ||
<code | ||
style={ | ||
Object { | ||
"backgroundColor": "#f3f2f2", | ||
"border": "1px solid #eae9e9", | ||
"borderRadius": 4, | ||
"color": "#3a3a3a", | ||
"fontSize": 15, | ||
"fontWeight": 600, | ||
"padding": "2px 5px", | ||
} | ||
}> | ||
App | ||
</code> | ||
component as a story. | ||
<div | ||
dangerouslySetInnerHTML={ | ||
Object { | ||
"__html": "<pre> | ||
// Add this code to \"src/stories/index.js\" | ||
|
||
import \'../index.css\'; | ||
import App from \'../App\'; | ||
|
||
storiesOf(\'App\', module) | ||
.add(\'default view\', () => ( | ||
<App /> | ||
)) | ||
</pre>", | ||
} | ||
} | ||
style={ | ||
Object { | ||
"backgroundColor": "#f3f2f2", | ||
"margin": "10px 0", | ||
"padding": "1px 10px", | ||
} | ||
} /> | ||
</p> | ||
<p> | ||
Usually we create stories with smaller UI components in the app. | ||
<br /> | ||
Have a look at the | ||
|
||
<a | ||
href="https://getstorybook.io/docs/basics/writing-stories" | ||
style={ | ||
Object { | ||
"borderBottom": "1px solid #1474f3", | ||
"color": "#1474f3", | ||
"paddingBottom": 2, | ||
"textDecoration": "none", | ||
} | ||
} | ||
target="_blank"> | ||
Writing Stories | ||
</a> | ||
|
||
section in our documentation. | ||
</p> | ||
</div> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import initStoryshots from 'storyshots'; | ||
initStoryshots(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tmeasday What do you think about creating an option
compareSnapshots
that defaults totrue
? I don't like the double negative ofnoMatchSnapshots
. Or just call the option you addedskipComparison
?