mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
[Editor] Don't make editable an empty freetext annotation
This commit is contained in:
parent
7588418b09
commit
19f7a8b899
3 changed files with 44 additions and 1 deletions
|
@ -1116,4 +1116,42 @@ describe("FreeText Editor", () => {
|
|||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe("FreeText with popup", () => {
|
||||
let pages;
|
||||
|
||||
beforeAll(async () => {
|
||||
pages = await loadAndWait(
|
||||
"annotation-freetext.pdf",
|
||||
".annotationEditorLayer"
|
||||
);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await closePages(pages);
|
||||
});
|
||||
|
||||
it("must not remove an empty annotation", async () => {
|
||||
await Promise.all(
|
||||
pages.map(async ([browserName, page]) => {
|
||||
await page.hover("[data-annotation-id='23R']");
|
||||
// Wait for the popup to be displayed.
|
||||
await page.waitForFunction(
|
||||
`document.querySelector("[data-annotation-id='popup_23R']").hidden === false`
|
||||
);
|
||||
|
||||
// Enter in editing mode.
|
||||
await page.click("#editorFreeText");
|
||||
await page.waitForTimeout(10);
|
||||
await page.click("#editorFreeText");
|
||||
|
||||
await page.hover("[data-annotation-id='23R']");
|
||||
// Wait for the popup to be displayed.
|
||||
await page.waitForFunction(
|
||||
`document.querySelector("[data-annotation-id='popup_23R']").hidden === false`
|
||||
);
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue