From c848001546e0a007f0d7294698599846b3bbc4c5 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Fri, 3 Apr 2026 00:27:30 +0200 Subject: [PATCH] Update box brush authoring E2E test to include tool mode checks and escape key handling --- tests/e2e/box-brush-authoring.e2e.ts | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/tests/e2e/box-brush-authoring.e2e.ts b/tests/e2e/box-brush-authoring.e2e.ts index b26f5d9c..fad18d23 100644 --- a/tests/e2e/box-brush-authoring.e2e.ts +++ b/tests/e2e/box-brush-authoring.e2e.ts @@ -1,6 +1,6 @@ import { expect, test } from "@playwright/test"; -import { clickViewport } from "./viewport-test-helpers"; +import { clickViewport, getEditorStoreSnapshot } from "./viewport-test-helpers"; test("user can create a box brush and keep it through a draft reload", async ({ page }) => { const pageErrors: string[] = []; @@ -22,6 +22,30 @@ test("user can create a box brush and keep it through a draft reload", async ({ }, "webeditor3d.scene-document-draft"); await page.reload(); + await page.getByRole("button", { name: "Box Create" }).click(); + await expect(await getEditorStoreSnapshot(page)).toMatchObject({ + toolMode: "create", + viewportTransientState: { + toolPreview: { + kind: "create", + sourcePanelId: "topLeft", + target: { + kind: "box-brush" + }, + center: null + } + } + }); + await page.keyboard.press("Escape"); + await expect(await getEditorStoreSnapshot(page)).toMatchObject({ + toolMode: "select", + viewportTransientState: { + toolPreview: { + kind: "none" + } + } + }); + await page.getByRole("button", { name: "Box Create" }).click(); await clickViewport(page); await expect(page.getByRole("button", { name: /Box Brush 1/ })).toBeVisible();