To really understand what is happening in your code, it would be useful to see your component code (in particular, your onChange handler.
However, with regard to the following code:
input.simulate('change', {target: {value: 'abc'}});
This will not actually change the value of your <input /> element, instead, it will simply run your onChange function and an event object will be provided that looks like {target: {value: 'abc'}} .
The idea is that your onChange function onChange updated your state or storage, so enabling this function will update your DOM. Unless you actually have an onChange handler defined with input.simulate('change') , it will do nothing.
So, if your goal is to actually set the input value and not start the onChange handler, then you can use JS to manually update the DOM with something like wrapper.find('#my-input').node.value = 'abc'; however, this bypasses the React rendering cycle, and you are likely to have this value cleared / deleted if you do anything to cause a re-rendering.
Levi
source share