Replies: 1 comment 4 replies
-
All events are dispatched per user-event/src/event/dispatchEvent.ts Lines 6 to 43 in 8215e2e The user-event/src/event/behavior/keypress.ts Lines 25 to 30 in 8215e2e |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a form with a text input, a submit button (
button[type="submit"]
) and anonSubmit
event handler that triggers a bunch of state updates and effects.If I write my test as follows, everything works fine:
However, if I type
{Enter}
in the text field to submit the form instead of pressing the button, I get an act warning:It seems that form submission on
Enter
is handled via the intermediatekeypress
event that@testing-library/user-event
dispatches. Is it possible that@testing-library/user-event
somehow forgets to wrap this form submission inact
?Beta Was this translation helpful? Give feedback.
All reactions