-
Notifications
You must be signed in to change notification settings - Fork 29
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 broken setup stories #3896
Fix broken setup stories #3896
Conversation
@@ -42,7 +56,13 @@ export default { | |||
} as Meta | |||
|
|||
const Template: StoryFn = ({ data }) => { | |||
const app = <App /> | |||
const app = ( | |||
<Provider store={configureStore({ reducer: setupReducers })}> |
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.
You can pass a preloaded state here instead of using dispatch and feeding the store like you currently do. The good part about this is that the story is ready on the get-go, it's not going to change while the store is being fed. Also, you won't need to export stuff from the webview simply for the story.
<Provider
store={configureStore({
preloadedState: { ...data },
reducer: experimentsReducers
})}
>
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.
On further inspection, we'd need to adjust our DEFAULT_DATA
to be configured like our redux state object for us to pass it as our preloadedState
. While we could do that, it would make the DEFAULT_DATA
harder to adjust with its nested state objects. I'll keep the MockedState
component for now to make story creation simpler.
Code Climate has analyzed commit be33351 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (85% is the threshold). This pull request will bring the total coverage in the repository to 94.9% (0.0% change). View more on Code Climate. |
Noticed while working on #3895 that our setup stories were broken
Leftover from #3851