Skip to content

docs: Port 'How Should I Query?' guide from Native Testing Library #555

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

Merged
merged 5 commits into from
Oct 12, 2020

Conversation

pplytas
Copy link
Contributor

@pplytas pplytas commented Sep 28, 2020

Summary

This PR ports the 'How Should I Query?' guide from this page: https://www.native-testing-library.com/docs/guide-queries.
The 'Manual Queries' section is not included since the findAll method is not supported by the current version of the library.
Fixes #512

Also these methods were not documented in the original guide, maybe we could add them:

  • ByA11yStates, ByAccessibilityStates
  • ByA11yState, ByAccessibilityState
  • ByA11Value, ByAccessibilityValue

Wdyt?

Test plan

Tested using yarn start in the website/ directory.

Copy link
Member

@mdjastrzebski mdjastrzebski left a comment

Choose a reason for hiding this comment

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

@pplytas Overall good idea 👍

I guess we could add short desc for a11yState + a11yValue. IMO there is no need for adding a11yStates as this got deprecated in RN, so is kind of compat query right now.

Copy link
Member

@thymikee thymikee left a comment

Choose a reason for hiding this comment

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

@pplytas I've reworded this a big to follow https://testing-library.com/docs/guide-which-query#priority more. Also reordered a few queries (mainly moved hint and label a bit down) and added missing ones. Thanks!

@mdjastrzebski can you give it a go one more time?

Copy link
Member

@mdjastrzebski mdjastrzebski left a comment

Choose a reason for hiding this comment

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

Looks good :+1

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.

Port guides from Native Testing Library
3 participants