From 86500de2d1917b0dfa7db27c05ff7034ad846d52 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Wed, 22 Apr 2026 14:03:49 +0200 Subject: [PATCH] auto-git: [change] tests/serialization/project-document-json.test.ts --- .../project-document-json.test.ts | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/tests/serialization/project-document-json.test.ts b/tests/serialization/project-document-json.test.ts index b64bab10..88fe7b37 100644 --- a/tests/serialization/project-document-json.test.ts +++ b/tests/serialization/project-document-json.test.ts @@ -24,6 +24,7 @@ import { RUNNER_LOADING_SCREEN_SCENE_DOCUMENT_VERSION, SCHEDULER_CONTROL_EFFECTS_SCENE_DOCUMENT_VERSION, SCENE_DOCUMENT_VERSION, + WHITEBOX_BOX_LIGHT_VOLUME_SCENE_DOCUMENT_VERSION, createEmptyProjectDocument, createEmptyProjectScene } from "../../src/document/scene-document"; @@ -531,6 +532,7 @@ describe("project document JSON", () => { } }; document.scenes["scene-cellar"].world.projectTimeLightingEnabled = false; + document.scenes["scene-cellar"].world.showCelestialBodies = true; document.assets["asset-night-sky"] = { id: "asset-night-sky", kind: "image", @@ -957,6 +959,39 @@ describe("project document JSON", () => { ).toBe(true); }); + it("defaults legacy scene world celestial body overlays to disabled", () => { + const document = createEmptyProjectDocument({ + name: "Celestial Overlay Project" + }); + const activeScene = document.scenes[document.activeSceneId]; + + if (activeScene === undefined) { + throw new Error("Expected an active scene in the project document."); + } + + const migratedDocument = parseProjectDocumentJson( + JSON.stringify({ + ...document, + version: WHITEBOX_BOX_LIGHT_VOLUME_SCENE_DOCUMENT_VERSION, + scenes: { + [activeScene.id]: { + ...activeScene, + world: { + ...activeScene.world, + showCelestialBodies: undefined + } + } + } + }) + ); + + expect(migratedDocument.version).toBe(SCENE_DOCUMENT_VERSION); + expect( + migratedDocument.scenes[migratedDocument.activeSceneId]?.world + .showCelestialBodies + ).toBe(false); + }); + it("migrates pre-project-name multi-scene documents to Untitled Project", () => { const migratedDocument = parseProjectDocumentJson( JSON.stringify({