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
simulate shouldn't be used; it doesn't faithfully simulate anything.
If you want to change the input's value, set the value prop on it; if you want to invoke an onChange, invoke it.
If you're doing something unidiomatic for React, and binding events directly to reffed DOM elements, then you'll have to test them by directly interacting with the DOM elements as well.
in this case, you're not actually using onChange, you're letting react-hook-form manipulate the DOM directly. I'm not really sure how you'd test that; that sounds like a react antipattern to me tbh :-/
I'm late to the party. I just learned that simulate is deprecated. I think the confusion for people is because this info isn't so clear in the doc. There is an existing PR for this atm.
Current behavior
As the title says, when I try to
simulate
achange
on my<input/>
, the input'svalue
remains the same - it doesn't change.Here is my HTML. This
<input/>
is within a<form/>
register
is from theuseForm
hook ofreact-hook-form
.Here is my mount.
The
<form/>
and<input/>
are within the<Signup/>
component.Here is my enzyme code
Here is the output
I don't see
value
anywhere.Expected behavior
Your environment
API
Version
Adapter
The text was updated successfully, but these errors were encountered: