1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 22:58:07 +02:00

Add the color changes in the annotation storage

This commit is contained in:
Calixte Denizet 2023-07-29 18:15:23 +02:00
parent 7ae5a0fef7
commit d16d1f0d23
4 changed files with 57 additions and 12 deletions

View file

@ -20,6 +20,7 @@ const {
getQuerySelector,
getComputedStyleSelector,
loadAndWait,
getFirstSerialized,
} = require("./test_utils.js");
describe("Interaction", () => {
@ -751,10 +752,22 @@ describe("Interaction", () => {
delay: 10,
});
for (const [id, propName, expected] of [
[41, "backgroundColor", "rgb(255, 0, 0)"],
[43, "color", "rgb(0, 255, 0)"],
[44, "border-top-color", "rgb(0, 0, 255)"],
for (const [id, propName, storedName, expected, storedExpected] of [
[
41,
"backgroundColor",
"backgroundColor",
"rgb(255, 0, 0)",
[255, 0, 0],
],
[43, "color", "color", "rgb(0, 255, 0)", [0, 255, 0]],
[
44,
"border-top-color",
"borderColor",
"rgb(0, 0, 255)",
[0, 0, 255],
],
]) {
const current = await page.$eval(
getSelector(ref),
@ -775,6 +788,11 @@ describe("Interaction", () => {
propName
);
expect(color).withContext(`In ${browserName}`).toEqual(expected);
const storedValue = (await getFirstSerialized(page))[storedName];
expect(storedValue)
.withContext(`In ${browserName}`)
.toEqual(storedExpected);
}
}
})

View file

@ -63,6 +63,7 @@ exports.clearInput = async (page, selector) => {
await page.keyboard.press("A");
await page.keyboard.up("Control");
await page.keyboard.press("Backspace");
await page.waitForTimeout(10);
};
function getSelector(id) {