From 1bfa562a61f77e53e26ba3e8ec61844a3c6a22dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20T=C3=B6rcsv=C3=A1ri?= Date: Mon, 8 Jun 2026 16:38:37 +0200 Subject: [PATCH] test(pcbnew): assert collab add preserves each item's layer Adds a layer-preservation check to the footprint/via/zone/text round-trip add tests, documenting + verifying that an item's own serialized layer is applied by makeItem and the peer editor's active layer is never consulted. 4 add tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) --- tests/kicad/pcbnew-collab.spec.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/kicad/pcbnew-collab.spec.ts b/tests/kicad/pcbnew-collab.spec.ts index 98db7d4..c27fbdc 100644 --- a/tests/kicad/pcbnew-collab.spec.ts +++ b/tests/kicad/pcbnew-collab.spec.ts @@ -249,6 +249,9 @@ test.describe("pcbnew collab bridge — single page", () => { const snap = JSON.parse(window.Module.kicadCollabSnapshot()); return snap.added.find((it: { id: string }) => it.id === i); }, id); + // The item's own layer travels in the delta and is applied explicitly by makeItem — it does + // NOT pick up the peer editor's active layer. (Footprint layer = which side it sits on.) + expect(after.layer, `${label} layer preserved`).toBe(payload.layer); if (type === "PCB_TEXT") { expect(after.text, "text string preserved").toBe(payload.text); expect(after.hjust, "text horizontal justification preserved").toBe(payload.hjust);