-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[Bug]: userEvent.click()
not working as expected after upgrading Storybook to 8.x
#26888
Comments
Could it be related to this issue? |
hmmm, it seems so! i just re-checked on Chrome and Safari and Also switching to The strange thing tho is that in latest versio nof |
In 7.x we used an older version which didnt had this bug. But this older version had other bugs that had no workaround.. So we decided it was most sensible to upgrade. |
testing-library/user-event looks unmaintained at the moment, no pull requests merged for ~7 months, no response to a question asking about maintenance status for over a month. Not really a good situation since Storybook is using it as a foundational dependency and re-exporting it. 🥲 |
I'm experiencing it too on 8.3.6 on chrome.. |
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 fireEvent does a lot less than userEvent, so you might have to manually do the stuff that userEvent does (focus, hover etc). This has to be fixed in testing-library-user-event itself. So I think we should close this issue here. @jaens The maintainer of tl/user-event responded to you. Hopefully, some fixes get merged soon. |
Describe the bug
I have some components that use
<input type="checkbox" />
or<details>
+<summary>
tags.When using Storybook
7.x
, interactions tests that useduserEvent.click()
worked just fine, but after upgrading to8.x
the same stories without any changes in code just stopped working.To Reproduce
Create a component that uses a
<details>
+<summary>
tags and write an interaction test that click the summary to open<details>
or a component using<input type="checkbox">
and an interaction test clicking the input.In first case, the
open
attribute won't be triggered and in second casechecked
attribute won't be triggered.System
Additional context
Not working in Storybook
8.x
Reproduction code:
storybook-8x.mov
Working in Storybook
7.x
Reproduction code:
storybook-7x.mov
The text was updated successfully, but these errors were encountered: