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

Better document testing-library's queries, e.g. getByRole #22598

Open
kylegach opened this issue May 17, 2023 · 2 comments
Open

Better document testing-library's queries, e.g. getByRole #22598

kylegach opened this issue May 17, 2023 · 2 comments
Assignees

Comments

@kylegach
Copy link
Contributor

kylegach commented May 17, 2023

Related discussions: #22429 (comment) and #22429 (comment)

I don't think we should document the full API, but we should point to https://testing-library.com/docs/queries/about in a clear and obvious manner, perhaps with one key example demonstrating a reasonably-full usage of their API.

@domyen
Copy link
Member

domyen commented Jun 14, 2023

Since we expose the testing library API as a first class feature, I think we should provide examples of Interaction Testing in action with "common UI engineering use cases".

For example:

  • Opening a dialog with a click or hover
  • Fill in a form and submit
  • Wait on an AnimateIn to load before firing a user event
  • Some recommendation on which to use between queryBy, findBy, etc

I get that we don't want to just parrot the TL API, but I suspect not exposing more of it is preventing folks from adopting Interaction Testing by adding an extra click to another website.

@kylegach
Copy link
Contributor Author

As of https://github.com/storybookjs/testing-library/releases/tag/v0.2.0, this should now include the user-event@14 API as well (e.g. pointer).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

No branches or pull requests

2 participants