React uses its own events system with SyntheticEvents
(prevents browser incompatabilities and gives react more control of events).
Using TestUtils
correctly creates such a event which will trigger your onChange
listener.
The dispatchEvent
function on the other hand will create a “native” browser event. But the event handler you have is managed by react and therefore only reacts (badumts) to reacts SyntheticEvents
.
You can read up on react events here: https://facebook.github.io/react/docs/events.html