-
-
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
How to pass custom data from story to storyshots ? #4330
Comments
Currently, it's not possible. We have this #4010 that will make it possible after some refactoring probably. you can do something like this (but it's 🤢) storiesOf( 'AbilitiesForm', module )
.add(
'basic',
() => {
const component = <AbilitiesForm />;
component.jestWaitTime = 1500;
return component;
}
); and then in your storyshot: const storyElement = story.render( context );
const waitTime = storyElement.jestWaitTime || 1; IDK if it's working |
React does not allow us to do this:
|
maybe something like this ? storiesOf( 'AbilitiesForm', module )
.add(
'basic',
() => {
const component = <AbilitiesForm />;
if (proccess.env.STORYBOOK_MODE === 'test') {
return {
component,
jestWaitTime: 1500,
}
}
return component;
}
); you will need to set |
It works, it will be better when we can pass parameters to The initial problem and I would like to wait for the end of my |
Yeah, it's not the best. Maybe you can pass the |
I'm using version
4.0.0-alpha.24
from@storybook/react
and@storybook/addon-storyshots
.The example below comes from the doc, I would like to know how to replace the value of
waitTime
by a parameter coming from the stories, do you have an idea?Something like:
Thank you !
The text was updated successfully, but these errors were encountered: