-
-
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
Fix default args aggregation in StoryStore. #12992
Conversation
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.
I wonder if this fix will remove the need for |
Yes, that is what happening per my understanding. You can have a look at this line:
|
Oops, did not see the last comment. Yeah, it should help. I guess my PR is not needed then? |
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
Issue: #12540
TL;DR
I faced a problem causing storyshots to fail with 0 tests found which is caused by undefined/null argument passed into one of the stories.
Symptoms
Snapshot test run fails with message:
The error is confusing and does not give any hints as the root cause. Storybook works fine and is not affected.
Sample repo that demonstrates an issue can be found here: https://github.com/vskh/storybook-storyshots-found-0-stories
Root cause
Passing in explicitly undefined argument to the story will break storyshots stories detection, e.g.:
In StoryStore, ArgTypes inference in this case is returning undefined entry which then fails to decompose the way that default arguments aggregation expects (see the actual fix).
Retrospectively, now that I know the cause it seems to be not a big deal and rather me doing weird thing instead of omitting an argument (omitting makes it work fine) but I spent few hard hours trying to figure out how two packages with seemingly same configuration exhibit different behaviour so I thought to submit a fix if someone ever hits the same.
What I did
How to test
jest lib/client-api/src/story_store.ts