mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 22:58:07 +02:00
When changing a property on a radio button then change it for the siblings (bug 1922766)
This commit is contained in:
parent
689ffda9df
commit
86d1272d1b
5 changed files with 57 additions and 12 deletions
|
@ -2499,4 +2499,47 @@ describe("Interaction", () => {
|
|||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("Change radio property", () => {
|
||||
let pages;
|
||||
|
||||
beforeAll(async () => {
|
||||
pages = await loadAndWait("bug1922766.pdf", "[data-annotation-id='44R']");
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await closePages(pages);
|
||||
});
|
||||
|
||||
it("must check that a change on a radio implies the change on all the radio in the group", async () => {
|
||||
await Promise.all(
|
||||
pages.map(async ([browserName, page]) => {
|
||||
await waitForScripting(page);
|
||||
|
||||
const checkColor = async color => {
|
||||
await waitForSandboxTrip(page);
|
||||
for (const i of [40, 41, 42, 43]) {
|
||||
const bgColor = await page.$eval(
|
||||
`[data-element-id='${i}R']`,
|
||||
el => getComputedStyle(el).backgroundColor
|
||||
);
|
||||
expect(bgColor)
|
||||
.withContext(`In ${browserName}`)
|
||||
.toEqual(`rgb(${color.join(", ")})`);
|
||||
}
|
||||
};
|
||||
await checkColor([255, 0, 0]);
|
||||
await page.click("[data-annotation-id='44R']");
|
||||
await checkColor([0, 0, 255]);
|
||||
await page.click("[data-annotation-id='44R']");
|
||||
await checkColor([255, 0, 0]);
|
||||
|
||||
await page.click("[data-annotation-id='43R']");
|
||||
await waitForSandboxTrip(page);
|
||||
await page.click("[data-annotation-id='44R']");
|
||||
await checkColor([0, 0, 255]);
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
|
@ -678,3 +678,4 @@
|
|||
!issue15096.pdf
|
||||
!issue18036.pdf
|
||||
!issue18894.pdf
|
||||
!bug1922766.pdf
|
||||
|
|
BIN
test/pdfs/bug1922766.pdf
Executable file
BIN
test/pdfs/bug1922766.pdf
Executable file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue