-
Notifications
You must be signed in to change notification settings - Fork 5
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
Interactions with userEvent are not executed before happo snapshots #95
Comments
Thanks for the report -- I'll have a look at this and see if I can figure out a fix after the weekend. 🙏 |
Thanks for making the reproduction repo, it's been a great help when debugging this! 🎉 It looks like this is because we are setting |
I've made an update to our workers and things are looking better: Thanks for filing the issue and the help with the repo! At first I thought this was because of the event happening asynchronously, so I did some work on happo-plugin-storybook as well, there's a new version with slightly better behavior around user events: https://github.com/happo/happo-plugin-storybook/releases/tag/v3.2.4 . Note however that this release isn't needed in your case, the worker update I did is enough to make the user event work. |
Oh, forgot to mention: this is fixed in Chrome and Firefox for now. Safari will be updated in our next release cycle which should be in the next couple of weeks. |
Thank you for the quick fix, it's working. 🎉 I observed another thing with |
Just a quick note here -- I had to revert this change/fix on our workers. I'll come up with a better fix tomorrow, the one I deployed had some side-effects that weren't great. I'll update this thread when I have a proper fix! |
It turns out that I tried hard to avoid having to use a configuration option, but it ended up being really tricky to avoid all types of spurious hover effects caused by allowing pointer-events. 🤷♂️ |
I'm using Storybook in combination with
@storybook/addon-interactions
, so I can defineplay
functions that perform UI interactions before the snapshot is taken.Interactions with
fireEvent
are working correctly, they're executed before the snapshot is taken.Interactions with
userEvent
are working in storybook, but are not executed before the snapshot is taken.Is that unsupported or is it a bug?
I created a demo repo to demonstrate this:
https://github.com/Q-Man/happo-storybook-userevent/
Here's my code:
These are the resulting Happo snapshots:
The text was updated successfully, but these errors were encountered: