-
Notifications
You must be signed in to change notification settings - Fork 224
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
test: Improve snapshot infrastructure and organization #687
Conversation
One thought: I wonder if we could update our storybook config to automatically enable chromatic if the story is in the |
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
* | ||
* TODO: Clean up after optional chaining is enabled | ||
*/ | ||
export const withSnapshotsEnabled: { |
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.
Note: I looked at making this a regular storybook decorator so you could do something like
export default {
title: 'My Story',
decorators: [withSnapshotsEnabled]
}
However, editing the storyFn.story
object doesn't seem to work from within the decorator function. This must be a limitation of the Storybook decorator API.
NB: Within our testing is it worth noting the difference between |
@mannycarrera4 Yeah it's worth considering. I don't think it's been a point of confusion so far though. Not sure what I would want to see instead. |
* test: Add helper to enable chromatic snapshots * test(button): Refactor visual testing stories to use CSF * test(form-field): Refactor visual testing stories to use CSF * test(pagination): Refactor visual testing stories to use CSF * test(select): Refactor visual testing stories to use CSF * test(popup): Refactor visual testing stories to use CSF * test(toast): Refactor visual testing stories to use CSF * test(form-field): Rename testing stories into their own section * test(button): Rename testing stories into their own section * test: Rename remainder of testing stories into their own section * fix(form-field): Fix import * refactor: Add category to create-component script and use CSF * feat: Add CSF visual testing story to create-component script * fix(form-field): Remove unused variable * fix(form-field): Properly export theme stories * refactor: Use a decorator for enabling snapshots * feat: Add override to withSnapshotsEnabled so it can be used per story
* test: Add helper to enable chromatic snapshots * test(button): Refactor visual testing stories to use CSF * test(form-field): Refactor visual testing stories to use CSF * test(pagination): Refactor visual testing stories to use CSF * test(select): Refactor visual testing stories to use CSF * test(popup): Refactor visual testing stories to use CSF * test(toast): Refactor visual testing stories to use CSF * test(form-field): Rename testing stories into their own section * test(button): Rename testing stories into their own section * test: Rename remainder of testing stories into their own section * fix(form-field): Fix import * refactor: Add category to create-component script and use CSF * feat: Add CSF visual testing story to create-component script * fix(form-field): Remove unused variable * fix(form-field): Properly export theme stories * refactor: Use a decorator for enabling snapshots * feat: Add override to withSnapshotsEnabled so it can be used per story
Addresses infrastructure improvements in #683
Testing
top level section within storybook.New "Testing" section:
