Skip to content
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

Find a way to pass parameters to a storybook decorator in unit tests #4

Open
NicolasBonduel opened this issue Jun 29, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@NicolasBonduel
Copy link
Owner

I am using a decorator for mocking one of my import, however, I did not find a way to pass parameters to the mocked import when rendering an exported story into a jest/react-library test.

See here, the problematic test (skipped at the moment):

test.skip('Load countries when some list elements are already saved in localStorage', () => {

Documentation for using decorators to mock imports: https://storybook.js.org/docs/riot/workflows/build-pages-with-storybook#mocking-imports

Relevant information: storybookjs/storybook#10145

@NicolasBonduel NicolasBonduel added the bug Something isn't working label Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant