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:
parent
255e982542
commit
dca54c8f8a
4 changed files with 42 additions and 1 deletions
|
@ -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");
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
|
@ -575,3 +575,4 @@
|
|||
!issue16021.pdf
|
||||
!bug1770750.pdf
|
||||
!issue16063.pdf
|
||||
!issue16067.pdf
|
||||
|
|
BIN
test/pdfs/issue16067.pdf
Executable file
BIN
test/pdfs/issue16067.pdf
Executable file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue