-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
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
Firefox: userEvent.click does not submit forms #1075
Comments
I believe this bug affects more than it looks, also in chromiums, but I cannot prove it. |
Our chromatic interaction tests that runs in chrome (or chromium, not sure if headless or not), using storybook Downgrading to 14.3.0 seems to fix the issue. |
@ph-fritsche This issue is introduced with 14.4.0 (#1003 or #1009?) and is not reproducible in 14.3.0, if that helps. |
Seeing similar issues here with |
I'm seeing this behaviour too but it's inconsistent - in some storybook tests Seeing it on testing-library/user-events 14.4.3 but also on the latest 14.5.1, in combination with Storybook 7.3.2 |
This was an (unsuccesful) attempt to make userEvent.click(submitButton) actually submit the form(s) on Firefox, but it is bugged in testing library itself, see: testing-library/user-event#1075
This was an (unsuccesful) attempt to make userEvent.click(submitButton) actually submit the form(s) on Firefox, but it is bugged in testing library itself, see: testing-library/user-event#1075
Workaround: export const Submitting = {
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
const submitButton = canvas.getByRole('button', { name: /Submit/i });
- await userEvent.click(submitButton);
+ await fireEvent.click(submitButton);
},
}; But @ph-fritsche I don't really understand why this works, because I thought userEvent uses fireEvent under the hood. |
fireEvent only didn't work for me but if add userEvent that's work
edit : userEvent work in google chrome |
@ph-fritsche is this something you're still considering working on? Thank you! |
Reproduction example
https://codesandbox.io/s/nervous-microservice-nmm3h7?file=/src/index.js
Prerequisites
<button type="submit" />
.userEvent.click
to click the button in the form.Expected behavior
Form's onSubmit handler should trigger.
Actual behavior
Form's onSubmit handler does not trigger.
User-event version
14.4.3
Environment
Firefox 106.0.2 (64-bit) Linux
Additional context
No response
The text was updated successfully, but these errors were encountered: