-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Need to make the storybook addon-storyshots more stable #21485
Comments
I'd argue that this is the best move too. I experienced these difficulties myself in several PRs. One potential good thing about story shots was the automatic a11y tests but these are not implemented yet. So I'd be in favor of removing the test for now until we figure out better options. Right now, these tests are useless. |
I'd agree with this as well 👍. They've been tricky for me to work with 😅
That would be awesome! Thank you! |
I'm not opposed to removing it, and for me it's probably the best option for the moment. That being said, to the noted issues:
|
Yes, I should have been clearer. The combination of the |
In working to add all of the components to Storybook, addon-storyshots is proving difficult to maintain. The biggest issue in my mind is that all of the snapshots run in the same context, causing two problems:
useInstanceId
as its id (e.g. SelectControl ) gets incremented whenever another story with that component gets added. This causes confusion as un-related stories snapshots can change whenever a new one is added.There is an option in the add-on to split the snapshots into individual files located in the
/stories/
directory within each component. Unfortunately, this doesn't prevent the second issue because the stories are still executed in the same context, the results are just written out to different files. It does, however, make it easier to see what happened.I have a proof-of-concept PR started to show how the individual snapshots might look: #21484
Based on my research into the add-on, I can't see how to get around the first problem without writing separate snapshot tests for each story. That seems to defeat the whole purpose of the addon - at that point, we are just rewriting the unit-tests of the component in my opinion.
So, the other option is to stop using addon-storyshots altogether. I thought I would open this issue to serve as a place for discussion. I'm happy to do the work, I just was hoping to get some opinions on which way to go or if there were any other options I was missing.
The text was updated successfully, but these errors were encountered: