mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
Implement a helper function for unselecting an editor in the integration tests
This has multiple advantages: - it improves consistency between the various editor integration tests; - it makes the code easier to read/understand; - it reduces code duplication.
This commit is contained in:
parent
c051dd78cf
commit
895edafc23
4 changed files with 19 additions and 22 deletions
|
@ -41,6 +41,7 @@ import {
|
|||
selectEditor,
|
||||
serializeBitmapDimensions,
|
||||
switchToEditor,
|
||||
unselectEditor,
|
||||
waitForAnnotationEditorLayer,
|
||||
waitForAnnotationModeChanged,
|
||||
waitForEntryInStorage,
|
||||
|
@ -48,7 +49,6 @@ import {
|
|||
waitForSerialized,
|
||||
waitForStorageEntries,
|
||||
waitForTimeout,
|
||||
waitForUnselectedEditor,
|
||||
} from "./test_utils.mjs";
|
||||
import { fileURLToPath } from "url";
|
||||
import fs from "fs";
|
||||
|
@ -1056,8 +1056,7 @@ describe("Stamp Editor", () => {
|
|||
.toEqual("Review alt text");
|
||||
|
||||
// Unselect and select the editor and check that the badge is visible.
|
||||
await page.keyboard.press("Escape");
|
||||
await waitForUnselectedEditor(page, editorSelector);
|
||||
await unselectEditor(page, editorSelector);
|
||||
await page.waitForSelector(".editToolbar", { visible: false });
|
||||
await page.waitForSelector(".noAltTextBadge", { visible: true });
|
||||
|
||||
|
@ -1106,8 +1105,7 @@ describe("Stamp Editor", () => {
|
|||
.toEqual("Missing alt text");
|
||||
|
||||
// Unselect and select the editor and check that the badge is visible.
|
||||
await page.keyboard.press("Escape");
|
||||
await waitForUnselectedEditor(page, editorSelector);
|
||||
await unselectEditor(page, editorSelector);
|
||||
await page.waitForSelector(".editToolbar", { visible: false });
|
||||
await page.waitForSelector(".noAltTextBadge", { visible: true });
|
||||
await page.evaluate(() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue