Add tests for box brush commands, E2E, geometry, and update scene document serialization test

This commit is contained in:
2026-03-31 02:06:44 +02:00
parent b676dc2e1f
commit cc180d305a
4 changed files with 239 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
import { expect, test } from "@playwright/test";
test("user can create a box brush and keep it through a draft reload", async ({ page }) => {
const pageErrors: string[] = [];
const consoleErrors: string[] = [];
page.on("pageerror", (error) => {
pageErrors.push(error.message);
});
page.on("console", (message) => {
if (message.type() === "error") {
consoleErrors.push(message.text());
}
});
await page.goto("/");
await page.evaluate((storageKey) => {
window.localStorage.removeItem(storageKey);
}, "webeditor3d.scene-document-draft");
await page.reload();
await page.getByTestId("create-box-brush").click();
await expect(page.getByText("Box Brush 1")).toBeVisible();
await expect(page.getByText("1 brush selected (Box Brush 1)")).toBeVisible();
await page.getByRole("button", { name: "Save Draft" }).click();
await page.reload();
await expect(page.getByText("Box Brush 1")).toBeVisible();
await expect(page.getByText("1 box brushes loaded. Click a brush in the viewport or outliner to select it.")).toBeVisible();
expect(pageErrors).toEqual([]);
expect(consoleErrors).toEqual([]);
});