mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
[Editor] Avoid to throw when an highlight annotation is resetted
This commit is contained in:
parent
e3fd62d726
commit
350e3e7b1c
2 changed files with 34 additions and 1 deletions
|
@ -2020,4 +2020,37 @@ describe("Highlight Editor", () => {
|
|||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("Highlight editor mustn't throw when disabled", () => {
|
||||
let pages;
|
||||
|
||||
beforeAll(async () => {
|
||||
pages = await loadAndWait(
|
||||
"annotation-highlight.pdf",
|
||||
".annotationEditorLayer"
|
||||
);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await closePages(pages);
|
||||
});
|
||||
|
||||
it("must enable & disable highlight mode successfully", async () => {
|
||||
await Promise.all(
|
||||
pages.map(async ([browserName, page]) => {
|
||||
const modeChangedHandle = await waitForAnnotationModeChanged(page);
|
||||
await switchToHighlight(page);
|
||||
await awaitPromise(modeChangedHandle);
|
||||
|
||||
await page.waitForSelector("#highlightParamsToolbarContainer", {
|
||||
visible: true,
|
||||
});
|
||||
await switchToHighlight(page, /* disable */ true);
|
||||
await page.waitForSelector("#highlightParamsToolbarContainer", {
|
||||
visible: false,
|
||||
});
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue