20 lines
970 B
TypeScript
20 lines
970 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
|
|
import { hasExactShkFirstSteps, SHK_FIRST_STEPS } from "./tenantBootstrap.constants";
|
|
|
|
describe("SHK first-steps catalog identity", () => {
|
|
it("accepts only the exact canonical id, order, and block tuples", () => {
|
|
expect(hasExactShkFirstSteps(SHK_FIRST_STEPS)).toBe(true);
|
|
|
|
for (const change of [{ id: "generated-step" }, { order: 999 }, { block: "unexpected" }]) {
|
|
expect(hasExactShkFirstSteps(SHK_FIRST_STEPS.map((step, index) => (index === 0 ? { ...step, ...change } : { ...step })))).toBe(false);
|
|
}
|
|
});
|
|
|
|
it("rejects missing, duplicated, and additional steps", () => {
|
|
expect(hasExactShkFirstSteps(SHK_FIRST_STEPS.slice(1))).toBe(false);
|
|
expect(hasExactShkFirstSteps([SHK_FIRST_STEPS[0], SHK_FIRST_STEPS[0], SHK_FIRST_STEPS[2], SHK_FIRST_STEPS[3]])).toBe(false);
|
|
expect(hasExactShkFirstSteps([...SHK_FIRST_STEPS, { id: "extra", order: 50, block: "extra" }])).toBe(false);
|
|
});
|
|
});
|