1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 09:38:06 +02:00

Implement a linting rule to discourage using waitForTimeout for new tests

The `waitForTimeout` function should not be used anymore and only exists
for old usages that have to be rewritten, but there was nothing in place
to signal this. This commit therefore implements a linting rule, specific
to the integration tests, to make it clear that this function should no
longer be used. We exclude the old usages from it because we are already
tracking those in #17656 (so this patch is mostly to not make the scope
of that issue bigger).
This commit is contained in:
Tim van der Meij 2024-04-09 15:59:23 +02:00
parent a208d6bca7
commit d4633ba478
No known key found for this signature in database
GPG key ID: 8C3FD2925A5F2762
5 changed files with 50 additions and 0 deletions

View file

@ -105,6 +105,7 @@ async function clearInput(page, selector) {
await page.click(selector);
await kbSelectAll(page);
await page.keyboard.press("Backspace");
// eslint-disable-next-line no-restricted-syntax
await waitForTimeout(10);
}
@ -343,6 +344,7 @@ async function serializeBitmapDimensions(page) {
async function dragAndDropAnnotation(page, startX, startY, tX, tY) {
await page.mouse.move(startX, startY);
await page.mouse.down();
// eslint-disable-next-line no-restricted-syntax
await waitForTimeout(10);
await page.mouse.move(startX + tX, startY + tY);
await page.mouse.up();