From f71039966df4f39ae0e7ff4867b2bfb3575b78f0 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Sat, 4 Apr 2026 20:18:38 +0200 Subject: [PATCH] Update viewport-test-helpers.ts with new selection properties and clickViewportAtRatio function --- tests/e2e/viewport-test-helpers.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/e2e/viewport-test-helpers.ts b/tests/e2e/viewport-test-helpers.ts index 1d7a152c..8dc5ba66 100644 --- a/tests/e2e/viewport-test-helpers.ts +++ b/tests/e2e/viewport-test-helpers.ts @@ -23,7 +23,12 @@ interface EditorStoreSnapshot { selection: { kind: string; ids?: string[]; + brushId?: string; + faceId?: string; + edgeId?: string; + vertexId?: string; }; + whiteboxSelectionMode: string; toolMode: string; document: { assets: Record; @@ -153,6 +158,22 @@ export async function clickViewport(page: Page, panelId: string = DEFAULT_VIEWPO } } +export async function clickViewportAtRatio(page: Page, panelId: string, xRatio: number, yRatio: number) { + const viewportCanvas = getViewportCanvas(page, panelId); + const box = await viewportCanvas.boundingBox(); + + if (box === null) { + throw new Error(`Missing viewport canvas for ${panelId}.`); + } + + await viewportCanvas.click({ + position: { + x: box.width * xRatio, + y: box.height * yRatio + } + }); +} + export async function setSharedBoxCreationPreview( page: Page, panelId: ViewportPanelId,