From 1056f76602db2a012b03fd6f88238dd023fe2ca6 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Tue, 12 May 2026 22:14:35 +0200 Subject: [PATCH] Add test case for applying rigid delta to multi-path-point previews --- tests/unit/transform-surface-snap.test.ts | 35 +++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/tests/unit/transform-surface-snap.test.ts b/tests/unit/transform-surface-snap.test.ts index eb5d1fd7..278da082 100644 --- a/tests/unit/transform-surface-snap.test.ts +++ b/tests/unit/transform-surface-snap.test.ts @@ -128,6 +128,41 @@ describe("transform-surface-snap", () => { }); }); + it("applies one rigid delta to multi-path-point previews", () => { + const preview = applyRigidDeltaToTransformPreview( + { + kind: "pathPoints", + pivot: { x: 1, y: 0, z: 1 }, + items: [ + { + pointId: "point-a", + position: { x: 0, y: 0, z: 0 } + }, + { + pointId: "point-b", + position: { x: 2, y: 0, z: 2 } + } + ] + }, + { x: 3, y: 4, z: -1 } + ); + + expect(preview).toEqual({ + kind: "pathPoints", + pivot: { x: 4, y: 4, z: 0 }, + items: [ + { + pointId: "point-a", + position: { x: 3, y: 4, z: -1 } + }, + { + pointId: "point-b", + position: { x: 5, y: 4, z: 1 } + } + ] + }); + }); + it("resolves the closest valid front-face hit while excluding the moving selection", () => { const excludedMesh = new Mesh( new BoxGeometry(1, 1, 1),