Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f31038c

Browse files
committedFeb 18, 2025·
.
1 parent e2ab4ab commit f31038c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎src/user-event/press/__tests__/press.real-timers.test.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ describe('userEvent.press with real timers', () => {
3434
);
3535

3636
await user.press(screen.getByTestId('pressable'));
37+
// Typical event order is pressIn, pressOut, press
38+
// But sometimes due to a race condition, the order is pressIn, press, pressOut.
3739
const eventSequence = getEventsNames(events).join(', ');
3840
expect(
3941
eventSequence === 'pressIn, pressOut, press' || eventSequence === 'pressIn, press, pressOut',
@@ -201,11 +203,11 @@ describe('userEvent.press with real timers', () => {
201203
);
202204
await user.press(screen.getByTestId('pressable'));
203205

204-
const eventsNames = getEventsNames(events).join(', ');
206+
const eventSequence = getEventsNames(events).join(', ');
205207
// Typical event order is pressIn, pressOut, press
206208
// But sometimes due to a race condition, the order is pressIn, press, pressOut.
207209
expect(
208-
eventsNames === 'pressIn, pressOut, press' || eventsNames === 'pressIn, press, pressOut',
210+
eventSequence === 'pressIn, pressOut, press' || eventSequence === 'pressIn, press, pressOut',
209211
).toBe(true);
210212
});
211213

0 commit comments

Comments
 (0)
Please sign in to comment.