1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Merge pull request #18719 from calixteman/bug1917543

[Editor] Avoid to have the ML disclaimer when the ML engine isn't ready (bug 1917543)
This commit is contained in:
calixteman 2024-09-09 22:12:46 +02:00 committed by GitHub
commit f98e6040cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 24 additions and 0 deletions

View file

@ -1096,5 +1096,28 @@ describe("Stamp Editor", () => {
await page.waitForSelector("#newAltTextDialog", { visible: false });
}
});
it("must check the new alt text flow (part 3)", async () => {
// Run sequentially to avoid clipboard issues.
for (const [, page] of pages) {
await page.evaluate(() => {
window.PDFViewerApplication.mlManager.enableAltTextModelDownload = false;
});
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 });
// Check we haven't the disclaimer.
await page.waitForSelector("#newAltTextDisclaimer[hidden]");
}
});
});
});