From 5126210fffb6e45752755922034d5be2abbaf2e2 Mon Sep 17 00:00:00 2001 From: Tim van der Meij Date: Sat, 4 Jan 2025 19:15:26 +0100 Subject: [PATCH] Use the `waitForUnselectedEditor` integration test helper function more This commit applies the `waitForUnselectedEditor` helper function to the remaining places, that most likely predate the introduction of the helper function, to deduplicate the code and to have a unified way of checking if a given editor is unselected. --- test/integration/highlight_editor_spec.mjs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/integration/highlight_editor_spec.mjs b/test/integration/highlight_editor_spec.mjs index 1584accb38150..06e1d44e564e6 100644 --- a/test/integration/highlight_editor_spec.mjs +++ b/test/integration/highlight_editor_spec.mjs @@ -38,6 +38,7 @@ import { waitForSelectedEditor, waitForSerialized, waitForTimeout, + waitForUnselectedEditor, } from "./test_utils.mjs"; import { fileURLToPath } from "url"; import fs from "fs"; @@ -1044,9 +1045,7 @@ describe("Highlight Editor", () => { await page.mouse.click(x, y, { count: 2, delay: 100 }); await page.waitForSelector(`${getEditorSelector(0)}`); await page.keyboard.press("Escape"); - await page.waitForSelector( - `${getEditorSelector(0)}:not(.selectedEditor)` - ); + await waitForUnselectedEditor(page, getEditorSelector(0)); await setCaretAt( page, @@ -1797,7 +1796,7 @@ describe("Highlight Editor", () => { await page.waitForSelector(editorSelector); await waitForSerialized(page, 1); await page.keyboard.press("Escape"); - await page.waitForSelector(`${editorSelector}:not(.selectedEditor)`); + await waitForUnselectedEditor(page, editorSelector); const clickHandle = await waitForPointerUp(page); y = rect.y - rect.height; @@ -1868,7 +1867,7 @@ describe("Highlight Editor", () => { await page.waitForSelector(editorSelector); await waitForSerialized(page, 1); await page.keyboard.press("Escape"); - await page.waitForSelector(`${editorSelector}:not(.selectedEditor)`); + await waitForUnselectedEditor(page, editorSelector); const clickHandle = await waitForPointerUp(page); y = rect.y - 3 * rect.height;