`fireEvent` updates in 3.0.2 introduced a regression
vbabel opened this issue · 1 comments
vbabel commented
preact-testing-library
version: 3.0.2 onwardpreact
version: 10.7.2node
version: 16.15.0npm
(oryarn
) version: 8.5.5
Relevant code or config
...
import { fireEvent } from 'testing-library/preact'
test('fireEvent passes on event init', () => {
const handler = jest.fn()
document.body.addEventListener('keydown', handler)
const init = { key: 'Escape' }
fireEvent.click(document.body, init)
expect(handler).toHaveBeenCalledWith(expect.objectContaining(init))
})
What you did:
Upgraded @testing-library/preact
from 3.0.1 to 3.2.0
What happened:
Tests passing event init to fireEvent
imported from @testing-library/preact
now failing.
Reproduction repository:
See this commit in my fork: vbabel@3df9d42
These tests fail without the fix.
Problem description:
fireEvent
updates introduced a regression.
Suggested solution:
Handle event init in the preact specific fireEvent.
JoviDeCroock commented
Fixed in #63 and released as 3.2.1