Repository navigation
Remove event simulation of onChange events in tests - #13176
Conversation
It’s time to get rid of even more `ReactTestUtils.Simulate`s. In this PR we remove the event simulation from all onChange tests. To do this, we have to get a setter to the untracked value/checked props. All remaining `ReactTestUtils.Simulate` calls are either testing ReactTestUtils or assert that they do/don't throw.
| expect(firstRadioNode.checked).toBe(true); | ||
| }); | ||
|
|
||
| it('should control radio buttons if the tree updates during render', () => { |
There was a problem hiding this comment.
I’ve changed the order here slightly such that we can dispatch the event on the node that is already appended to the document.
|
I wonder if we should dispatch The reason here being that |
This sounds good to me |
|
@gaearon Great! I changed to |
|
Thank you! |
* Remove event simulation of onChange events It’s time to get rid of even more `ReactTestUtils.Simulate`s. In this PR we remove the event simulation from all onChange tests. To do this, we have to get a setter to the untracked value/checked props. All remaining `ReactTestUtils.Simulate` calls are either testing ReactTestUtils or assert that they do/don't throw. * Use input instead of change event for all but checkbox, radio, and select
* Remove event simulation of onChange events It’s time to get rid of even more `ReactTestUtils.Simulate`s. In this PR we remove the event simulation from all onChange tests. To do this, we have to get a setter to the untracked value/checked props. All remaining `ReactTestUtils.Simulate` calls are either testing ReactTestUtils or assert that they do/don't throw. * Use input instead of change event for all but checkbox, radio, and select
It’s time to get rid of even more
ReactTestUtils.Simulates. In this PR we remove the event simulation from all onChange tests. To do this, we have to get a setter to the untracked value/checked props.All remaining
ReactTestUtils.Simulatecalls are either testing ReactTestUtils or assert that they do/don't throw.