Open rluvaton opened 1 year ago
Before I start adding tests, what do you think about this?
Cc @kentcdodds
I'll reopen this and I'd be willing to look at a PR for this. https://github.com/testing-library/dom-testing-library/issues/196#issuecomment-628268484
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 c546d527afc5739376800704b566fc12a058420e:
Sandbox | Source |
---|---|
react-testing-library-examples | Configuration |
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).
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 *ByRole
as that hidden: true
there means to show hidden as well
While in the *ByText
we want to exclude them, and if we use the same configuration we would break our users as currently defaultHidden
is false - meaning that we don't return hidden results and which is not what we currently do for *ByText
queries...
What: add
excludeHidden
option for*ByText
queriesWhy: #196
How: used the already existing
isInaccessible
functionChecklist: