Skip to content

Commit

Permalink
Ensure timers can trigger for copy & paste tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Xon committed Aug 28, 2024
1 parent a5ecb1e commit a93c5b8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test-e2e/test-suit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,15 @@ export class TestSuit {
async pasteText(text: string, _locator?: Locator): Promise<void> {
const locator = _locator || this.input;
await locator.focus();
await this.advanceClock();

await this.crossProcessLock(async () => {
await this.page.evaluate(`navigator.clipboard.writeText('${text}')`);
await this.advanceClock();
await this.ctrlV(locator);
});

await this.advanceClock();
await expect(locator).toHaveValue(text);
}
}

0 comments on commit a93c5b8

Please sign in to comment.