Skip to content

Commit

Permalink
Reduce flakiness
Browse files Browse the repository at this point in the history
  • Loading branch information
calebeby committed Jul 29, 2024
1 parent f947828 commit b8a4fc9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/user/type.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@ test(
await utils.injectHTML(`<textarea>1234</textarea>`);
const input = await screen.getByRole('textbox');
let startTime = Date.now();
await user.type(input, '123');
expect(Date.now() - startTime).toBeLessThan(100);
await user.type(input, '1234567890');
expect(Date.now() - startTime).toBeLessThan(200);
startTime = Date.now();
await user.type(input, '123', { delay: 50 });
expect(Date.now() - startTime).toBeGreaterThan(150);
await user.type(input, '1234567890', { delay: 100 });
expect(Date.now() - startTime).toBeGreaterThan(1000);
}),
);

Expand Down

0 comments on commit b8a4fc9

Please sign in to comment.