Skip to content

Commit 6198fd2

Browse files
authored
test: poll for the async wheel event in the user-event fixture (#10732)
1 parent e060b8f commit 6198fd2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

test/browser/fixtures/user-event/wheel.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ describe.for([
5555

5656
await (testType === 'userEvent' ? userEvent.wheel(selector, options) : selector.wheel(options))
5757

58-
expect(wheel).toHaveBeenCalledOnce()
58+
// the wheel event is dispatched asynchronously in the browser, so poll for
59+
// it instead of asserting synchronously (matches the default-delta case above)
60+
await expect.poll(() => wheel).toHaveBeenCalledOnce()
5961
expect(wheel.mock.calls[0][0].deltaX).toBe(deltaX)
6062
expect(wheel.mock.calls[0][0].deltaY).toBe(deltaY)
6163
})

0 commit comments

Comments
 (0)