We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://codesandbox.io/p/devbox/elated-gould-h5tv93
<label><span>label</span><input type="checkbox" /></label>
The checkbox should be checked.
The checkbox is still unchecked.
14.5.2
Testing Library framework:
JS framework:
Test environment:
DOM implementation:
No response
The text was updated successfully, but these errors were encountered:
Same here. "CLICK" gets logged but the test fails:
import { fireEvent, render, screen } from "@testing-library/react" import userEvent from "@testing-library/user-event" const user = userEvent.setup() test('click', async () => { render( <div> <label htmlFor="checkbox" onClick={() => console.log("CLICK")}>Check</label> <input id="checkbox" type="checkbox" /> </div>, ) await user.click(screen.getByText('Check')) // fireEvent.click(screen.getByText('Check')) expect(screen.getByLabelText('Check')).toBeChecked() })
Sorry, something went wrong.
No branches or pull requests
Reproduction example
https://codesandbox.io/p/devbox/elated-gould-h5tv93
Prerequisites
<label><span>label</span><input type="checkbox" /></label>
Expected behavior
The checkbox should be checked.
Actual behavior
The checkbox is still unchecked.
User-event version
14.5.2
Environment
Testing Library framework:
JS framework:
Test environment:
DOM implementation:
Additional context
No response
The text was updated successfully, but these errors were encountered: