-
Notifications
You must be signed in to change notification settings - Fork 28
Use @storybook/testing-library for Storybook play functions #2005
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
Conversation
This should make writing play functions easier, since we can use the full testing-library query suite
wolmir
left a comment
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.
Thanks!
|
Can we use the testing library user-event package directly? |
941e6b2 to
22b2546
Compare
I tried it out and it seems we cannot, doing so makes |
|
@rogermparent Storybook actually looks broken. |
| const plot = await within(canvasElement).findByTestId( | ||
| 'plots-section_template-multi_1' | ||
| ) | ||
| await within(plot).findByRole('graphics-document') |
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.
This waits until the initial plot is rendered before we click on it, and fixes the weird Storybook issue we were having where the multiview plot disappeared. I think that bug was more due to vega instead of storybook, and the new Storybook config is just bringing a symptom to surface.
|
Code Climate has analyzed commit 31838ba 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 96.6% (0.0% change). View more on Code Climate. |
mattseddon
left a comment
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.
PR description has the chain pointing in the wrong direction

this <- #1991 & #2010
This official storybook library should allow us to use the full testing-library query suite in
playfunctions, particularlyuserEventwhich errors out when imported from@testing-library/react.