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
I realize that it's not sustainable to have to set all the possible fields for a simulated event, but the type at least makes sense for verification that you're getting the right sort of event.
The text was updated successfully, but these errors were encountered:
It’s not just limited to type. You can add more data to the synthetic event exactly the same way. It will get attached to the event instance with an assign() call.
While there is no official way to also pass a fake nativeEvent, you should be able to use exactly the same technique for it:
SyntheticEvent.type
is undefined when received by the handler. Or the nativeEvent type for that matter.Needs to be added in here somewhere:
react/src/test/ReactTestUtils.js
Line 496 in 3a4e1db
I realize that it's not sustainable to have to set all the possible fields for a simulated event, but the type at least makes sense for verification that you're getting the right sort of event.
The text was updated successfully, but these errors were encountered: