queryByTestId
, getByTestId
use partial case-insensitive text match by default, which is unexpected
#8
Labels
bug
Something isn't working
good first issue
Good for newcomers
help wanted
Extra attention is needed
dom-testing-library
version: 1.1.0node
version: N/Anpm
(oryarn
) version: N/ARelevant code or config
What you did:
data-testid="supertest-123"
to an empty DOM.getByTestId
by string"tEsT"
.What happened:
The element with
data-testid="supertest-123"
was found.Reproduction repository:
https://codesandbox.io/s/pwrpl1yy9x?module=%2Fsrc%2Findex.js
Problem description:
The current behavior is unexpected, the identifiers aren't supposed to be matched partially and case-insensitively.
Suggested solution:
Use case-sensitive full-string match in
queryByTestId
,getByTestId
.The text was updated successfully, but these errors were encountered: