r/learnreactjs • • May 06 '22

React Testing Library - what does "Queries Accessible by Everyone" mean?

I keep seeing that as the title of a major section of queries.

What does it mean? Why would you want your testing "accessible to everyone"? You or the other developers are the only ones who are gonna see the tests so I don't understand the perspective.

The other section titles are:

Semantic Queries

and

Test IDs

What section allows me to just pick the element I want to test and test it? Like grab a input field or an img tag or something along those lines? I don't understand the language. Does "accessible by everyone" just mean "anything on the website anyone can see"?

2 Upvotes

4 comments sorted by

View all comments

Show parent comment

1

u/BilboMcDoogle May 08 '22

Oh I see. Thank you now I get it lol.