From bb8d2328e60a80eb17eae855b01a816f0d653c11 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Wed, 13 May 2026 04:32:10 +0200 Subject: [PATCH] test(domain): Add test case for spline corridor colliders in runtime scene building --- tests/domain/build-runtime-scene.test.ts | 58 ++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/tests/domain/build-runtime-scene.test.ts b/tests/domain/build-runtime-scene.test.ts index 5073d373..f5334b4e 100644 --- a/tests/domain/build-runtime-scene.test.ts +++ b/tests/domain/build-runtime-scene.test.ts @@ -2005,6 +2005,64 @@ describe("buildRuntimeSceneFromDocument", () => { ]); }); + it("adds spline corridor box colliders for collision-enabled edges and repeaters", () => { + const path = createScenePath({ + id: "path-runtime-spline-corridor-collision", + road: { + enabled: true, + width: 2, + edges: { + left: { + enabled: true, + collisionEnabled: true, + kind: "curb", + width: 0.4, + height: 0.2, + materialId: null + } + } + }, + repeaters: [ + { + id: "repeater-runtime-collision", + assetId: "fence_segment_wood_2m", + collisionEnabled: true, + placement: "center", + spacing: 2 + } + ] + }); + + const runtimeScene = buildRuntimeSceneFromDocument({ + ...createEmptySceneDocument({ + name: "Runtime Spline Corridor Collision Scene" + }), + paths: { + [path.id]: path + } + }); + const corridorColliders = runtimeScene.staticColliders.filter( + (collider) => collider.source === "splineCorridor" + ); + + expect(corridorColliders).toHaveLength(3); + expect(corridorColliders).toEqual( + expect.arrayContaining([ + expect.objectContaining({ + edgeSide: "left", + kind: "box", + pathId: path.id + }), + expect.objectContaining({ + repeaterId: "repeater-runtime-collision", + assetId: "fence_segment_wood_2m", + kind: "box", + pathId: path.id + }) + ]) + ); + }); + it("includes authored foliage layers, prototypes, and terrain masks for derived rendering", () => { const bundledPrototype = BUNDLED_FOLIAGE_PROTOTYPES[0]!; const layer = createFoliageLayer({