-
Notifications
You must be signed in to change notification settings - Fork 468
Open
Labels
help wantedExtra attention is neededExtra attention is neededneeds discussionWe need to discuss this to come up with a good solutionWe need to discuss this to come up with a good solution
Description
Describe the feature you'd like:
A common pattern that I've been using is:
const element = getByText(...);
expect(element).toBeVisible();
However, it may be the case that there are invisible elements that match the first selector, leading to a thrown error since multiple elements were found. It would be much nicer to be able to write something like:
const element = getByText(..., {filter: isVisible}); // It would also be nice for jest-dom to export `isVisible`
Describe alternatives you've considered:
If theisVisible
use-case is by far the most common, then it could be sufficient to export queryVisibleBy*
methods directly.
mjlyons and matthew-gerstman
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is neededneeds discussionWe need to discuss this to come up with a good solutionWe need to discuss this to come up with a good solution