Skip to content

Commit 1d3a285

Browse files
authored
Add which-query extension to documentation (#569)
* Add which-query extension to documentation People come across the query page in the documentation, and they might not truly understand how to use `getByRole` or any other methods since they don't use to do that! They used to get an element by `class` name or `id` most of the time. Or they were simply using JQuery for many years. As a result, RTL's queries do not sound very familiar to them. The "which-query" chrome extension is a good place to help them get started. They can use it to learn how to access any element in the page, just by the help of RTL queries (instead of setting data-testid, ...) * link to Testing Playground extension
1 parent 473abdc commit 1d3a285

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

docs/guide-which-query.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ const { container } = render(<MyComponent />)
5757
const foo = container.querySelector('[data-foo="bar"]')
5858
```
5959

60+
## Chrome extension
61+
Do you still have problems knowing how to use Testing Library queries?
62+
63+
There is a very cool Chrome extension named [Testing Playground](https://chrome.google.com/webstore/detail/testing-playground/hejbmebodbijjdhflfknehhcgaklhano/related), and it helps you find the best queries to select elements. It allows you to inspect the element hierarchies in the Chrome Developer Tools, and provides you with suggestions on how to select them, while encouraging good testing practices.
64+
6065
## Playground
6166

6267
If you want to get more familiar with these queries, you can try them out on

0 commit comments

Comments
 (0)