-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
.addDecorator is probably not working #879
Comments
Comment by fredantell I'm running into the same issue. I have a component I specifically created for testing. I can use a global addDecorator and it works fine with storybooks. Then when I run storyshot via jest it fails trying to find functions that should have been injected via context. If I use addDecorator on a per story level it works fine in both storybooks and storyshots. |
Comment by jacobk I have this issue too with storyshots |
I have the same issue, Im using Styled Components and add the ThemeProvider to all the stories with the addDecorator. but the storyshots don't work when i use something like the withTheme component. Any update on this? Using the v3 |
@RussMax783 can we get a reproduction of this? It sounds similar to #877, which I failed to reproduce. Would love to get a reproduction going! |
Here is a reproduction: Run: |
Thanks @ktj that's great! |
I'm guessing just moving the This seems like a documentation problem more than anything. Perhaps the global |
Yup, that has the same affect. I'd be game for logging a warning: it would have saved me a ton of time debugging this. |
@mattleff keen to try sending a PR? |
@tmeasday Sure, I'll try to send one in the next couple days. |
@shilman Can this issue be closed now? |
I'll mark it |
is it really solved? |
I don't believe so. I've still been seeing the issue for material-ui components, but haven't had the time to put together an example repo, so I haven't spoken up about it yet. |
yep, we faced this here react-theming/storybook-addon-material-ui#64 |
i'm happy to provide details of what we are seeing and help potential solutions, but may not have time to dig into coming up with solutions at this point. happy to provide what help i can though. |
Issue by kitze
Friday Dec 23, 2016 at 23:37 GMT
Originally opened as storybook-eol/storyshots#68
I'm using material-ui in my project for some of the components. The components that are not affected by material-ui and don't need muiTheme pass the tests. But the other components that need muiTheme provided by context, are failing with a warning
Warning: Failed context type: The context `muiTheme` is marked as required in `CircularProgress`, but its value is `undefined`.
Keep in mind that the stories in storybook are fine because I'm providing muiTheme through a decorator like this in my global .storybook/config.js file:
The text was updated successfully, but these errors were encountered: