From 07629e105cec1a786ec98e08baa785723239f0f7 Mon Sep 17 00:00:00 2001 From: Tim van der Meij Date: Sun, 23 Feb 2025 18:39:42 +0100 Subject: [PATCH] Deduplicate the `getXY` helper function in the highlight editor integration tests The helper function is available in `test_utils.mjs` since commit 301f1bb, so by exporting it there it can be reused. --- test/integration/highlight_editor_spec.mjs | 6 +----- test/integration/test_utils.mjs | 1 + 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/test/integration/highlight_editor_spec.mjs b/test/integration/highlight_editor_spec.mjs index 9ced1cf50..e24698ca5 100644 --- a/test/integration/highlight_editor_spec.mjs +++ b/test/integration/highlight_editor_spec.mjs @@ -22,6 +22,7 @@ import { getRect, getSerialized, getSpanRectFromText, + getXY, kbBigMoveLeft, kbBigMoveUp, kbFocusNext, @@ -60,11 +61,6 @@ const waitForPointerUp = page => const switchToHighlight = switchToEditor.bind(null, "Highlight"); -const getXY = async (page, selector) => { - const rect = await getRect(page, selector); - return `${rect.x}::${rect.y}`; -}; - describe("Highlight Editor", () => { describe("Editor must be removed without exception", () => { let pages; diff --git a/test/integration/test_utils.mjs b/test/integration/test_utils.mjs index 0f4a879e6..68761f187 100644 --- a/test/integration/test_utils.mjs +++ b/test/integration/test_utils.mjs @@ -901,6 +901,7 @@ export { getSelector, getSerialized, getSpanRectFromText, + getXY, hover, isCanvasWhite, isVisible,