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

Remove waitForTimeout usage from the clearInput helper function

We should wait until the input field's value is actually empty instead
of waiting for a fixed time (which could lead to intermittent failures).
This commit is contained in:
Tim van der Meij 2024-04-18 15:22:58 +02:00
parent 4866686749
commit 3f51da147c
No known key found for this signature in database
GPG key ID: 8C3FD2925A5F2762

View file

@ -115,8 +115,9 @@ 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);
await page.waitForFunction(
`document.querySelector('${selector}').value === ""`
);
}
function getSelector(id) {