Select option with React TestUtils Simulate Select option with React TestUtils Simulate reactjs reactjs

Select option with React TestUtils Simulate


The problem might be that Simulate.change only calls the select's onChange (which doesn't exist). I don't think it'll actually cause the select's value to change unless you cause that change in your onChange handler.

If you insist on using refs over onChange, change this line:

TestUtils.Simulate.change(selectComponent, { target: { value: 'type_a' } });

to this:

selectComponent.getDOMNode().value = 'type_a';