You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While trying to write tests for <CopyButton> (#2634), I found it quite difficult to properly test the hover events and delayed effects. I looked into how Mantine tests those things, and it turns out internally they use user-event:
You can see that depending of which element you are trying to click, userEvent will do a set of different actions (e.g. if it's a label or a checkbox).
There are probably many cases in react and app that could benefit from this.
The text was updated successfully, but these errors were encountered:
While trying to write tests for
<CopyButton>
(#2634), I found it quite difficult to properly test the hover events and delayed effects. I looked into how Mantine tests those things, and it turns out internally they useuser-event
:https://testing-library.com/docs/user-event/intro/#difference-to-fireevent
When to use userEvent.click and when to use fireEvent
There are probably many cases in
react
andapp
that could benefit from this.The text was updated successfully, but these errors were encountered: