1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

[Editor] Hide visible popups when editing

This commit is contained in:
Calixte Denizet 2023-06-21 10:41:19 +02:00
parent b8f5a14925
commit 8ae1c8dd81
2 changed files with 60 additions and 7 deletions

View file

@ -1153,5 +1153,31 @@ describe("FreeText Editor", () => {
})
);
});
it("must hide the popup when editing", async () => {
await Promise.all(
pages.map(async ([browserName, page]) => {
await page.click("[data-annotation-id='20R']");
// Wait for the popup to be displayed.
await page.waitForFunction(
`document.querySelector("[data-annotation-id='popup_20R']").hidden === false`
);
// Enter in editing mode.
await page.click("#editorFreeText");
// Wait for the popup to be hidden.
await page.waitForFunction(
`document.querySelector("[data-annotation-id='popup_20R']").hidden === true`
);
// Exit editing mode.
await page.click("#editorFreeText");
// Wait for the popup to be visible.
await page.waitForFunction(
`document.querySelector("[data-annotation-id='popup_20R']").hidden === false`
);
})
);
});
});
});