Skip to content

Conversation

@rogermparent
Copy link
Contributor

@rogermparent rogermparent commented Jul 8, 2022

this <- #1991 & #2010

This official storybook library should allow us to use the full testing-library query suite in play functions, particularly userEvent which errors out when imported from @testing-library/react.

This should make writing play functions easier, since we can use the
full testing-library query suite
Copy link
Contributor

@wolmir wolmir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@rogermparent rogermparent self-assigned this Jul 8, 2022
@mattseddon
Copy link
Contributor

mattseddon commented Jul 8, 2022

Can we use the testing library user-event package directly?

@rogermparent rogermparent force-pushed the storybook-testing-library branch from 941e6b2 to 22b2546 Compare July 9, 2022 06:46
@rogermparent
Copy link
Contributor Author

Can we use the testing library user-event package directly?

I tried it out and it seems we cannot, doing so makes play functions not execute in Chromatic.

mattseddon
mattseddon previously approved these changes Jul 11, 2022
@mattseddon
Copy link
Contributor

image

@rogermparent Storybook actually looks broken.

@mattseddon mattseddon dismissed their stale review July 11, 2022 22:22

Storybook is broken

const plot = await within(canvasElement).findByTestId(
'plots-section_template-multi_1'
)
await within(plot).findByRole('graphics-document')
Copy link
Contributor Author

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.

@qlty-cloud-legacy
Copy link

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.

Copy link
Contributor

@mattseddon mattseddon left a 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

@rogermparent rogermparent merged commit 16642c3 into main Jul 12, 2022
@rogermparent rogermparent deleted the storybook-testing-library branch July 12, 2022 11:59
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

Successfully merging this pull request may close these issues.

3 participants