mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
[Editor] Don't add an editor for empty FreeText annotations
This commit is contained in:
parent
5581e22cc7
commit
1ab34d2ae4
2 changed files with 27 additions and 0 deletions
|
@ -993,6 +993,29 @@ describe("FreeText Editor", () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe("FreeText (update existing but not empty ones)", () => {
|
||||
let pages;
|
||||
|
||||
beforeAll(async () => {
|
||||
pages = await loadAndWait("issue14438.pdf", ".annotationEditorLayer");
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await closePages(pages);
|
||||
});
|
||||
|
||||
it("must update an existing annotation but not an empty one", async () => {
|
||||
await Promise.all(
|
||||
pages.map(async ([browserName, page]) => {
|
||||
await page.click("#editorFreeText");
|
||||
|
||||
const editorIds = await getEditors(page, "freeText");
|
||||
expect(editorIds.length).withContext(`In ${browserName}`).toEqual(1);
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("FreeText (delete existing)", () => {
|
||||
let pages;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue