mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-29 15:47:57 +02:00
Use waitForSelector
instead of waitForFunction
for focus checks
This commit replaces `waitForFunction` calls that use `document.activeElement` to wait for an element to get focus by simpler `waitForSelector` expressions that use the `:focus` selector. Note that we already use this in other tests, so this improves consistency too.
This commit is contained in:
parent
5c5c107ec5
commit
bb743389aa
2 changed files with 4 additions and 16 deletions
|
@ -74,13 +74,7 @@ describe("Annotation highlight", () => {
|
|||
pages.map(async ([browserName, page]) => {
|
||||
for (const i of [23, 22, 14]) {
|
||||
await page.click(`[data-annotation-id='${i}R']`);
|
||||
await page.waitForFunction(
|
||||
id =>
|
||||
document.activeElement ===
|
||||
document.querySelector(`#pdfjs_internal_id_${id}R`),
|
||||
{},
|
||||
i
|
||||
);
|
||||
await page.waitForSelector(`#pdfjs_internal_id_${i}R:focus`);
|
||||
}
|
||||
})
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue