Closed
Description
@testing-library/dom
version: @testing-library/dom@7.29.4- Testing Framework and version: Karma
- karma@4.4.1
- jasmine@3.3.1
- DOM Environment: Chrome Version 88.0.4324.182 (Official Build) (x86_64)
Relevant code or config
Repro sandbox: https://codesandbox.io/s/react-testing-library-demo-forked-u4lcu?file=/src/__tests__/hello.js
What you did:
I ran a test and tried to click the result of screen.getAllByLabelText
.
What happened:
Running the test produces something like:
where the element in question is an array:
Problem description:
The thrown error is a bit ambiguous -- there is room for improvement.
Suggested solution:
I would assume that userEvent
methods would error on having multiple elements -- where the error text would be a bit more direct. I am not sure if a user can interact with more than 1 element at a time.
Metadata
Metadata
Assignees
Labels
No labels