From 8e1733ab2508d0639bf2f0c0f8169cb3d4f1312e Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Wed, 22 Apr 2026 13:00:28 +0200 Subject: [PATCH] auto-git: [change] tests/unit/world-background-renderer.test.ts --- tests/unit/world-background-renderer.test.ts | 32 ++++++++------------ 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/tests/unit/world-background-renderer.test.ts b/tests/unit/world-background-renderer.test.ts index ae8f7940..09748a70 100644 --- a/tests/unit/world-background-renderer.test.ts +++ b/tests/unit/world-background-renderer.test.ts @@ -32,27 +32,21 @@ describe("resolveWorldEnvironmentState", () => { environmentIntensity: 0.4 }; - expect( - resolveWorldEnvironmentState(world.background, dayTexture, { - texture: nightTexture, - opacity: 0.25, - environmentIntensity: 0.8 - }) - ).toEqual({ - texture: dayTexture, - intensity: 0.5 + const earlyTwilight = resolveWorldEnvironmentState(world.background, dayTexture, { + texture: nightTexture, + opacity: 0.25, + environmentIntensity: 0.8 + }); + const lateTwilight = resolveWorldEnvironmentState(world.background, dayTexture, { + texture: nightTexture, + opacity: 0.75, + environmentIntensity: 0.8 }); - expect( - resolveWorldEnvironmentState(world.background, dayTexture, { - texture: nightTexture, - opacity: 0.75, - environmentIntensity: 0.8 - }) - ).toEqual({ - texture: nightTexture, - intensity: 0.7000000000000001 - }); + expect(earlyTwilight.texture).toBe(dayTexture); + expect(earlyTwilight.intensity).toBeCloseTo(0.5); + expect(lateTwilight.texture).toBe(nightTexture); + expect(lateTwilight.intensity).toBeCloseTo(0.7); }); it("fades the night environment in when the authored day background has no image environment", () => {