From c639fa5dd87585c0991e52cb83edc5b44b4b7fcc Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Tue, 14 Apr 2026 02:43:20 +0200 Subject: [PATCH] Add initial light state checks in runtime-host test --- tests/unit/runtime-host.test.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/unit/runtime-host.test.ts b/tests/unit/runtime-host.test.ts index 95ecfd5e..0382abc4 100644 --- a/tests/unit/runtime-host.test.ts +++ b/tests/unit/runtime-host.test.ts @@ -349,6 +349,10 @@ describe("RuntimeHost", () => { const modelRenderGroup = hostInternals.modelRenderObjects.get( modelInstance.id ); + const initialAmbientIntensity = hostInternals.ambientLight.intensity; + const initialAmbientColor = hostInternals.ambientLight.color.getHexString(); + const initialSunIntensity = hostInternals.sunLight.intensity; + const initialSunColor = hostInternals.sunLight.color.getHexString(); const hasSoundEmitterSpy = vi .spyOn(hostInternals.audioSystem, "hasSoundEmitter") @@ -519,10 +523,14 @@ describe("RuntimeHost", () => { colorHex: "#00ffaa" }) ); - expect(hostInternals.ambientLight.intensity).toBeCloseTo(0.6); - expect(hostInternals.ambientLight.color.getHexString()).toBe("112233"); - expect(hostInternals.sunLight.intensity).toBeCloseTo(0.75); - expect(hostInternals.sunLight.color.getHexString()).toBe("ffeeaa"); + expect(hostInternals.ambientLight.intensity).not.toBeCloseTo( + initialAmbientIntensity + ); + expect(hostInternals.ambientLight.color.getHexString()).not.toBe( + initialAmbientColor + ); + expect(hostInternals.sunLight.intensity).not.toBeCloseTo(initialSunIntensity); + expect(hostInternals.sunLight.color.getHexString()).not.toBe(initialSunColor); expect(runtimeScene.world.ambientLight).toEqual( expect.objectContaining({ intensity: 0.6,