From fc2fa2e36a9c96002863d261c38c434493fb9ea7 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Tue, 31 Mar 2026 03:46:10 +0200 Subject: [PATCH] auto-git: [change] tests/e2e/box-brush-authoring.e2e.ts [change] tests/serialization/local-draft-storage.test.ts --- tests/e2e/box-brush-authoring.e2e.ts | 2 +- .../serialization/local-draft-storage.test.ts | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/tests/e2e/box-brush-authoring.e2e.ts b/tests/e2e/box-brush-authoring.e2e.ts index 4feea120..914a93ee 100644 --- a/tests/e2e/box-brush-authoring.e2e.ts +++ b/tests/e2e/box-brush-authoring.e2e.ts @@ -36,7 +36,7 @@ test("user can create a box brush and keep it through a draft reload", async ({ await expect(page.getByRole("button", { name: /Box Brush 1/ })).toBeVisible(); await expect(page.getByRole("button", { name: /center 0, 2, 0/ })).toBeVisible(); await expect(page.getByRole("button", { name: /size 2, 2, 4/ })).toBeVisible(); - await expect(page.getByText("1 box brushes loaded. Click a brush face in the viewport or use the face selector to texture it.")).toBeVisible(); + await expect(page.getByTestId("viewport-overlay")).toBeVisible(); expect(pageErrors).toEqual([]); expect(consoleErrors).toEqual([]); diff --git a/tests/serialization/local-draft-storage.test.ts b/tests/serialization/local-draft-storage.test.ts index db8b0548..664787ab 100644 --- a/tests/serialization/local-draft-storage.test.ts +++ b/tests/serialization/local-draft-storage.test.ts @@ -1,5 +1,6 @@ import { describe, expect, it } from "vitest"; +import { createBoxBrush } from "../../src/document/brushes"; import { SCENE_DOCUMENT_VERSION, createEmptySceneDocument } from "../../src/document/scene-document"; import { DEFAULT_SCENE_DRAFT_STORAGE_KEY, @@ -116,4 +117,21 @@ describe("local draft storage", () => { expect(result.status).toBe("error"); expect(result.message).toContain("quota exceeded"); }); + + it("refuses to save an invalid scene document draft", () => { + const invalidBrush = createBoxBrush({ + id: "brush-invalid" + }); + invalidBrush.faces.posX.materialId = "missing-material"; + + const result = saveSceneDocumentDraft(new MemoryStorage(), { + ...createEmptySceneDocument(), + brushes: { + [invalidBrush.id]: invalidBrush + } + }); + + expect(result.status).toBe("error"); + expect(result.message).toContain("validation error"); + }); });