Skip to content

Commit 633cb54

Browse files
author
Kent C. Dodds
committed
fix(revert): revert previous change (was a breaking change).
Revert "fix(change): no longer using Simulate.change" This reverts commit b464150.
1 parent b464150 commit 633cb54

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

src/__tests__/events.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const eventTypes = [
3030
},
3131
{
3232
type: 'Focus',
33-
events: ['input', 'invalid'],
33+
events: ['change', 'input', 'invalid'],
3434
elementType: 'input',
3535
},
3636
{
@@ -154,12 +154,3 @@ eventTypes.forEach(({type, events, elementType, init}) => {
154154
})
155155
})
156156
})
157-
158-
test('onChange works', () => {
159-
const handleChange = jest.fn()
160-
const {
161-
container: {firstChild: input},
162-
} = render(<input onChange={handleChange} />)
163-
fireEvent.change(input, {target: {value: 'a'}})
164-
expect(handleChange).toHaveBeenCalledTimes(1)
165-
})

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function cleanupAtContainer(container) {
4848
}
4949

5050
// fallback to synthetic events for React events that the DOM doesn't support
51-
const syntheticEvents = ['select', 'mouseEnter', 'mouseLeave']
51+
const syntheticEvents = ['change', 'select', 'mouseEnter', 'mouseLeave']
5252
syntheticEvents.forEach(eventName => {
5353
document.addEventListener(eventName.toLowerCase(), e => {
5454
Simulate[eventName](e.target, e)

0 commit comments

Comments
 (0)