From f9e50421c8b7182ee2635f7105cea901d3c8ceff Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Tue, 31 Mar 2026 04:41:13 +0200 Subject: [PATCH] Add test for switching selection while transform input is active --- tests/e2e/box-brush-authoring.e2e.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/e2e/box-brush-authoring.e2e.ts b/tests/e2e/box-brush-authoring.e2e.ts index 3507f59a..f1e76bad 100644 --- a/tests/e2e/box-brush-authoring.e2e.ts +++ b/tests/e2e/box-brush-authoring.e2e.ts @@ -51,3 +51,26 @@ test("user can create a box brush and keep it through a draft reload", async ({ expect(pageErrors).toEqual([]); expect(consoleErrors).toEqual([]); }); + +test("switching selection while a transform input is active does not overwrite the newly selected brush", async ({ page }) => { + await page.goto("/"); + await page.evaluate((storageKey) => { + window.localStorage.removeItem(storageKey); + }, "webeditor3d.scene-document-draft"); + await page.reload(); + + await page.getByRole("button", { name: "Box Create" }).click(); + await page.getByTestId("viewport-fallback-create-box").click(); + await page.getByRole("button", { name: "Box Create" }).click(); + await page.getByTestId("viewport-fallback-create-box").click(); + + await page.getByTestId("outliner-brush-brush-1").click(); + await page.getByTestId("brush-size-z").fill("4"); + await page.getByTestId("outliner-brush-brush-2").click(); + + await expect(page.getByText("1 brush selected (Box Brush 2)")).toBeVisible(); + await expect(page.getByTestId("brush-size-z")).toHaveValue("2"); + + await page.getByTestId("outliner-brush-brush-1").click(); + await expect(page.getByTestId("brush-size-z")).toHaveValue("4"); +});