test(chess/primitives): lock primitive registry count at 22 (T28)
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).
This commit is contained in:
parent
da436d5650
commit
420b5bae55
1 changed files with 18 additions and 0 deletions
|
|
@ -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();
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue