Added additional query for single case #628
Open
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.
What to solve
It is very common to use storybook's knobs addon for storybook component nowadays. The screenshot results can vary depending on how to set knobs, example: background: blue or red.
Also, they are set as query strings in browser or puppeteer. Currently, the package doesn't support to set specific knobs.
This is very similar to this one [Feature proposal] Integrate with the knobs add-on #34
But in short, I think we need ability to configure storybook component out of box --- from cli
Solution
Additional query param has been added in this commit to cli interface and StorybookPreviewBrowser to go to specific version of story. This works for knobs or args for controls in v6. But need to stick to this when writing the query to pass over to cli param (additionalQuery) . https://storybook.js.org/docs/react/writing-stories/args#setting-args-through-the-url
Note
It has to be used for one specific story. Otherwise, it will be appended to other stories when trying to get all the screenshots.