mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-08-03 12:57:20 +02:00
Compare commits
2 Commits
e738566900
...
92d7b6d09f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
92d7b6d09f | ||
|
|
2a4f970e00 |
@ -339,45 +339,44 @@ describe("Signature Editor", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("must check copy and paste", async () => {
|
it("must check copy and paste", async () => {
|
||||||
await Promise.all(
|
// Run sequentially to avoid clipboard issues.
|
||||||
pages.map(async ([browserName, page]) => {
|
for (const [browserName, page] of pages) {
|
||||||
await switchToSignature(page);
|
await switchToSignature(page);
|
||||||
await page.click("#editorSignatureAddSignature");
|
await page.click("#editorSignatureAddSignature");
|
||||||
|
|
||||||
await page.waitForSelector("#addSignatureDialog", {
|
await page.waitForSelector("#addSignatureDialog", {
|
||||||
visible: true,
|
visible: true,
|
||||||
});
|
});
|
||||||
await page.type("#addSignatureTypeInput", "Hello");
|
await page.type("#addSignatureTypeInput", "Hello");
|
||||||
await page.waitForSelector(`${addButtonSelector}:not(:disabled)`);
|
await page.waitForSelector(`${addButtonSelector}:not(:disabled)`);
|
||||||
await page.click("#addSignatureAddButton");
|
await page.click("#addSignatureAddButton");
|
||||||
|
|
||||||
const editorSelector = getEditorSelector(0);
|
const editorSelector = getEditorSelector(0);
|
||||||
await page.waitForSelector(editorSelector, { visible: true });
|
await page.waitForSelector(editorSelector, { visible: true });
|
||||||
const originalRect = await getRect(page, editorSelector);
|
const originalRect = await getRect(page, editorSelector);
|
||||||
const originalDescription = await page.$eval(
|
const originalDescription = await page.$eval(
|
||||||
`${editorSelector} .altText.editDescription`,
|
`${editorSelector} .altText.editDescription`,
|
||||||
el => el.title
|
el => el.title
|
||||||
);
|
);
|
||||||
|
|
||||||
await copy(page);
|
await copy(page);
|
||||||
await paste(page);
|
await paste(page);
|
||||||
|
|
||||||
const pastedEditorSelector = getEditorSelector(1);
|
const pastedEditorSelector = getEditorSelector(1);
|
||||||
await page.waitForSelector(pastedEditorSelector, { visible: true });
|
await page.waitForSelector(pastedEditorSelector, { visible: true });
|
||||||
const pastedRect = await getRect(page, pastedEditorSelector);
|
const pastedRect = await getRect(page, pastedEditorSelector);
|
||||||
const pastedDescription = await page.$eval(
|
const pastedDescription = await page.$eval(
|
||||||
`${pastedEditorSelector} .altText.editDescription`,
|
`${pastedEditorSelector} .altText.editDescription`,
|
||||||
el => el.title
|
el => el.title
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(pastedRect)
|
expect(pastedRect)
|
||||||
.withContext(`In ${browserName}`)
|
.withContext(`In ${browserName}`)
|
||||||
.not.toEqual(originalRect);
|
.not.toEqual(originalRect);
|
||||||
expect(pastedDescription)
|
expect(pastedDescription)
|
||||||
.withContext(`In ${browserName}`)
|
.withContext(`In ${browserName}`)
|
||||||
.toEqual(originalDescription);
|
.toEqual(originalDescription);
|
||||||
})
|
}
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user