mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Merge pull request #13272 from calixteman/issue13271
Update all the text widgets having the same name with the same value
This commit is contained in:
commit
da0e7ea969
4 changed files with 55 additions and 1 deletions
|
@ -87,3 +87,38 @@ describe("Checkbox annotation", () => {
|
|||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("Text widget", () => {
|
||||
describe("issue13271.pdf", () => {
|
||||
let pages;
|
||||
|
||||
beforeAll(async () => {
|
||||
pages = await loadAndWait("issue13271.pdf", "[data-annotation-id='24R']");
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await closePages(pages);
|
||||
});
|
||||
|
||||
it("must update all the fields with the same value", async () => {
|
||||
const base = "hello world";
|
||||
await Promise.all(
|
||||
pages.map(async ([browserName, page]) => {
|
||||
await page.type("#\\32 5R", base);
|
||||
await page.waitForFunction(
|
||||
`document.querySelector("#\\\\32 4R").value !== ""`
|
||||
);
|
||||
await page.waitForFunction(
|
||||
`document.querySelector("#\\\\32 6R").value !== ""`
|
||||
);
|
||||
|
||||
let text = await page.$eval("#\\32 4R", el => el.value);
|
||||
expect(text).withContext(`In ${browserName}`).toEqual(base);
|
||||
|
||||
text = await page.$eval("#\\32 6R", el => el.value);
|
||||
expect(text).withContext(`In ${browserName}`).toEqual(base);
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
|
@ -373,6 +373,7 @@
|
|||
!issue6106.pdf
|
||||
!issue6296.pdf
|
||||
!bug852992_reduced.pdf
|
||||
!issue13271.pdf
|
||||
!issue6298.pdf
|
||||
!issue6889.pdf
|
||||
!bug1001080.pdf
|
||||
|
|
BIN
test/pdfs/issue13271.pdf
Normal file
BIN
test/pdfs/issue13271.pdf
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue