Testing - How to simulate value change
I'm trying to write a test which checks that when I change the values, certain strings in the DOM change.
I'm trying to simulate a click on the track container or the slider, but it does not seem to register the click event. Or a mousedown event. Is this possible?
I'm in the same situation. Any ideas on this?
Any luck with this at all? I'm finding a way to programmatically animate a slider
It has some special way of testing, apparently https://github.com/davidchin/react-input-range/blob/master/test/input-range/input-range.spec.jsx
I've tested this by triggering the onChange event manually on a mounted component, not via the UI 😢
In case this helps anyone...
...
wrapper
.find('InputRange')
.instance()
.props.onChange(YOUR_NEW_VALUE);
await wrapper.update();
expect(...);
Where YOUR_NEW_VALUE would be 1 for example.