Skip to content

Commit

Permalink
Merge pull request #19516 from calixteman/bug1949201
Browse files Browse the repository at this point in the history
[Editor] Remove the error panel when the user click on an other tab (bug 1949201)
  • Loading branch information
calixteman authored Feb 20, 2025
2 parents d10cea5 + 12ba817 commit c52b5ba
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
48 changes: 48 additions & 0 deletions test/integration/signature_editor_spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -373,4 +373,52 @@ describe("Signature Editor", () => {
);
});
});

describe("Bug 1949201", () => {
let pages;

beforeEach(async () => {
pages = await loadAndWait("empty.pdf", ".annotationEditorLayer");
});

afterEach(async () => {
await closePages(pages);
});

it("must check that the error panel is correctly removed", async () => {
await Promise.all(
pages.map(async ([_, page]) => {
await switchToSignature(page);
await page.click("#editorSignatureAddSignature");

await page.waitForSelector("#addSignatureDialog", {
visible: true,
});
await page.click("#addSignatureImageButton");
await page.waitForSelector("#addSignatureImagePlaceholder", {
visible: true,
});
const input = await page.$("#addSignatureFilePicker");
await input.uploadFile(
`${path.join(__dirname, "./signature_editor_spec.mjs")}`
);
await page.waitForSelector("#addSignatureError", { visible: true });
await page.click("#addSignatureErrorCloseButton");
await page.waitForSelector("#addSignatureError", { visible: false });

await input.uploadFile(
`${path.join(__dirname, "./stamp_editor_spec.mjs")}`
);
await page.waitForSelector("#addSignatureError", { visible: true });

await page.click("#addSignatureTypeButton");
await page.waitForSelector(
"#addSignatureTypeButton[aria-selected=true]"
);
await page.waitForSelector("#addSignatureError", { visible: false });
await page.click("#addSignatureCancelButton");
})
);
});
});
});
1 change: 1 addition & 0 deletions web/signature_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ class SignatureManager {
this.#currentTab = name;
}

this.#errorBar.hidden = true;
const reset = !name;
if (reset) {
this.#resetCommon();
Expand Down

0 comments on commit c52b5ba

Please sign in to comment.