import { test } from "node:test"; import assert from "node:assert/strict"; import { RACK_IDENTITY, RACK_LAYERS } from "./rackLayout"; // Tailwind's default spacing scale: one unit = 0.25rem = 4 px. const px = (token: string, prefix: string) => { const m = new RegExp(`^${prefix}-(\\d+)$`).exec(token); assert.ok(m, `${token} is not a ${prefix}- token`); return Number(m[1]) * 4; }; const z = (token: string) => Number(/z-(\d+)$/.exec(token)?.[1]); test("the pinned Slug cell starts inside the checkbox cell — the overlap closes the seam", () => { assert.ok( px(RACK_IDENTITY.slugLeft, "left") < px(RACK_IDENTITY.checkboxWidth, "w"), ); }); test("the layer ladder is strict: popover > thead > group header > identity", () => { assert.ok(z(RACK_LAYERS.popover) > z(RACK_LAYERS.thead)); assert.ok(z(RACK_LAYERS.thead) > z(RACK_LAYERS.groupHeader)); assert.ok(z(RACK_LAYERS.groupHeader) > z(RACK_LAYERS.identity)); });