1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

[Editor] Remove the disclaimer when the user is editing the alt-text in the new alt-text modal (bug 1911764)

This commit is contained in:
Calixte Denizet 2024-08-30 22:19:12 +02:00
parent a61f4b0303
commit 4aea51b5bf
2 changed files with 81 additions and 38 deletions

View file

@ -1050,6 +1050,50 @@ describe("Stamp Editor", () => {
tooltipSelector
);
expect(tooltipText).toEqual("Hello World");
// Click on the Review button.
await page.click(buttonSelector);
await page.waitForSelector("#newAltTextDialog", { visible: true });
await page.click("#newAltTextCreateAutomaticallyButton");
await page.click("#newAltTextCancel");
await page.waitForSelector("#newAltTextDialog", { visible: false });
}
});
it("must check the new alt text flow (part 2)", async () => {
// Run sequentially to avoid clipboard issues.
for (const [, page] of pages) {
await switchToStamp(page);
// Add an image.
await copyImage(page, "../images/firefox_logo.png", 0);
const editorSelector = getEditorSelector(0);
await page.waitForSelector(editorSelector);
await waitForSerialized(page, 1);
// Wait for the dialog to be visible.
await page.waitForSelector("#newAltTextDialog", { visible: true });
// Wait for the spinner to be visible.
await page.waitForSelector("#newAltTextDescriptionContainer.loading");
// Check we've the disclaimer.
await page.waitForSelector("#newAltTextDisclaimer", { visible: true });
// Click in the textarea in order to stop the guessing.
await page.click("#newAltTextDescriptionTextarea");
await page.waitForFunction(() =>
document
.getElementById("newAltTextTitle")
.textContent.startsWith("Add ")
);
// Check we haven't the disclaimer.
await page.waitForSelector("#newAltTextDisclaimer", { visible: false });
// Click on the Not Now button.
await page.click("#newAltTextNotNow");
await page.waitForSelector("#newAltTextDialog", { visible: false });
}
});
});