At the point where you use the custom fireEventAsync, I somewhat randomly left it as await fireEvent, and it worked.
test('renders a counter', async () => {
const {getByText} = render(<Counter />)
const counter = getByText('0')
// This works
await fireEvent.click(counter)
expect(counter).toHaveTextContent('1')
// This still does not work
fireEvent.click(counter)
expect(counter).toHaveTextContent('2')
})
As you created fireEvent, it may be a recent change to it, who knows, just thought to mention it.
Hi @kentcdodds,
working on https://testingjavascript.com/lessons/javascript-use-dom-testing-library-with-preact
At the point where you use the custom fireEventAsync, I somewhat randomly left it as
await fireEvent
, and it worked.As you created
fireEvent
, it may be a recent change to it, who knows, just thought to mention it.Cheers!