Update box brush authoring E2E test to include tool mode checks and escape key handling

This commit is contained in:
2026-04-03 00:27:30 +02:00
parent 5718fd87fc
commit c848001546

View File

@@ -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();