-
Notifications
You must be signed in to change notification settings - Fork 470
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
add excludeHidden
for *ByText queries
#1184
base: main
Are you sure you want to change the base?
add excludeHidden
for *ByText queries
#1184
Conversation
Before I start adding tests, what do you think about this? Cc @kentcdodds
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit c546d52:
|
Honestly, I think this would be a worthwhile thing in all the queries and eventually should be enabled by default (which of course would be a breaking change). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use the same name for the option as ByRole does?
Also note that this has considerable perf impact. ByText etc are a faster, less accurate helper and with this change we're making the distinction between By* and ByRole less clear.
I think that's fair @eps1lon. As I'm no longer maintaining Testing Library, I don't think it's fair for me to make decisions here. I think the best would be to have this supported in all the queries and the "faster, less accurate helper" can be offered by using the option. |
I'm not fundamentally opposed. But the added dimension due to the naming of the option is a bigger concern for me right now. |
Oh, yeah, I agree we should probably keep the names consistent 👍 |
I used different name to avoid confusion with |
What: add
excludeHidden
option for*ByText
queriesWhy: #196
How: used the already existing
isInaccessible
functionChecklist:
docs site