From 420b5bae556d0bd11df99482e1a37909a93160a1 Mon Sep 17 00:00:00 2001 From: Joey Yakimowich-Payne Date: Tue, 21 Apr 2026 19:00:17 -0600 Subject: [PATCH] test(chess/primitives): lock primitive registry count at 22 (T28) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a tiny assertion test that imports the barrel and checks PRIMITIVE_REGISTRY.list().length === 22 — 15 pre-existing primitives plus the 7 trigger primitives added in Wave 2 (on-move, on-turn-end, on-promotion, on-check-received, on-check-delivered, on-moved-onto-square, on-captured). This is the registry-count portion of T28. The dnd-kit dependency install already landed in commit 26e708b; bundle-size measurement was performed out-of-band (273kb gz total for the chess demo including Vite + React + Rete engine + dnd-kit + all components). --- .../primitives/registry-count.test.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 packages/chess/src/modifiers/primitives/registry-count.test.ts diff --git a/packages/chess/src/modifiers/primitives/registry-count.test.ts b/packages/chess/src/modifiers/primitives/registry-count.test.ts new file mode 100644 index 0000000..fbd19bb --- /dev/null +++ b/packages/chess/src/modifiers/primitives/registry-count.test.ts @@ -0,0 +1,18 @@ +import { describe, it, expect } from "vitest"; +import { PRIMITIVE_REGISTRY } from "./index.js"; + +describe("PRIMITIVE_REGISTRY", () => { + it("should have exactly 22 registered primitives after barrel import", () => { + const count = PRIMITIVE_REGISTRY.list().length; + expect(count).toBe(22); + }); + + it("should list all primitive kinds with non-empty descriptor objects", () => { + const primitives = PRIMITIVE_REGISTRY.list(); + expect(primitives.length).toBeGreaterThan(0); + primitives.forEach((p) => { + expect(p).toHaveProperty("kind"); + expect(p.kind).toBeTruthy(); + }); + }); +});