How to call function props in stories?
See original GitHub issueHi, I am testing a component using Storyshots. This component contains function props like these:
action={() => action(key)}
actionReverse={() => actionReverse(key)}
However, since those functions are not called, I am unable to reach 100% coverage test on that component. How am I supposed to test those kind of props?
Thanks.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
How to call function props in stories? · Issue #1941
Hi, I am testing a component using Storyshots. This component contains function props like these: action={() => action(key)} ...
Read more >Play function - Storybook - JS.ORG
Play functions are small snippets of code executed after the story renders. ... Run the following command to install the addon and the...
Read more >Storybook call function which is a prop of the component
I have a component "Item" and a container. The container has a lazy Loading function, with which I load the items.
Read more >How passing props to component works in React
Master how to pass props (properties) to components in React with this useful beginner's guide, including demo code.
Read more >React: How To Access Props In A Functional Component
You have 2 free member-only stories left this month. ... them in your functional component callback just as you would with any other...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

You’re doing good =) To enable snapshotting, just add this line:
Got it, thanks! 😄