Using React Testing Library `userEvent` seems to invoke key presses
MistarzJan opened this issue · 2 comments
Version: 3.7.86
When trying to use React Testing Library userEvent.type
to fill the input with values Keyboard emits onKeyPress
as if the button on virtual keyboard was pressed. The issue does not exist outside of the test environment.
Is it intended/known behaviour? The input values are doubled, resulting in fails whenever userEvent.type
is used
Hello @MistarzJan, I don't use RTL so haven't experienced it yet. If you can provide a test repository where you can repro the issue, I would be able to look into this further.
Will reopen the thread once I get this actionable info. Thanks!
Hey!, I've tried to reproduce it, but failed, so it seems that the issue is on my end. However i have one question. Is there any way to programatically invoke onKeyPressed
function without actually pressing any of the buttons?