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

Add interactor support to interactive storybook stories #165

Open
jnicklas opened this issue Dec 10, 2021 · 0 comments
Open

Add interactor support to interactive storybook stories #165

jnicklas opened this issue Dec 10, 2021 · 0 comments

Comments

@jnicklas
Copy link
Collaborator

Interactors are a perfect fit for interactive stories, and fit nicely into the storybook ecosystem. We should provide a good experience for writing interactive stories using Storybook and debugging them using the @storybook/interactions addon.

Since we can add wrappers using the addActionWrapper API, we should be able to wrap all interactions so they can hook into the storybook instrumenter. But there are some issues. The instrumenter does not expose a public API to track any function, it is very geared towards wrapping testing-library. Furthermore when we try to do this by hooking into internal APIs, there are some issue with the storybook API, where it becomes frozen after stepping through the stories a few times.

I've set up a branch of Storybook here where we can see interactors in action within the storybook repo. This is useful for development. To set this up, grab the fork and then follow the setup instructions for storybook here. Finally when everything is set up, run:

cd examples/react-ts
yarn storybook

This will open up storybook, open up the "Demo" -> "Account Form" -> "Verification Success" story, which uses interactors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant