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

[JS] Send a Validate action on change on Choice widget

This commit is contained in:
Calixte Denizet 2023-02-19 16:33:05 +01:00
parent 255e982542
commit dca54c8f8a
4 changed files with 42 additions and 1 deletions

View file

@ -1854,4 +1854,43 @@ describe("Interaction", () => {
);
});
});
describe("in issue16067.pdf", () => {
let pages;
beforeAll(async () => {
pages = await loadAndWait("issue16067.pdf", getSelector("6R"));
});
afterAll(async () => {
await closePages(pages);
});
it("must check that a field has the correct value when a choice is changed", async () => {
await Promise.all(
pages.map(async ([browserName, page]) => {
await page.waitForFunction(
"window.PDFViewerApplication.scriptingReady === true"
);
let text = await page.$eval(getSelector("44R"), el => el.value);
expect(text).withContext(`In ${browserName}`).toEqual("");
await page.select(getSelector("6R"), "Yes");
await page.waitForTimeout(10);
text = await page.$eval(getSelector("44R"), el => el.value);
expect(text).withContext(`In ${browserName}`).toEqual("Yes");
await clearInput(page, getSelector("44R"));
await page.select(getSelector("6R"), "No");
await page.waitForTimeout(10);
text = await page.$eval(getSelector("44R"), el => el.value);
expect(text).withContext(`In ${browserName}`).toEqual("No");
})
);
});
});
});

View file

@ -575,3 +575,4 @@
!issue16021.pdf
!bug1770750.pdf
!issue16063.pdf
!issue16067.pdf

BIN
test/pdfs/issue16067.pdf Executable file

Binary file not shown.