Closed
Description
Versions
@testing-library/jest-dom
v5.16.5
@testing-library/react
v13.3.0
The problem
// Given that an option with the name "Option 1"
getByRole("option", { name: "option 1", exact: false }) // should return the element, but doesn't
Reproduction:
https://codesandbox.io/s/react-testing-library-repro-getbyrole-exact-false-5zzq2v
Problem description:
In the documentation we only see the use of regex when using getByRole
and the use of exact
when using getByText
. However the Typescript definition says the exact
option is available for getByRole
.
So it is either a type error or a runtime code error.
Suggested solution:
- Improve the documentation
- Fix the type
- Fix the implementation
Metadata
Metadata
Assignees
Labels
No labels