Files
clean-architecture-frontend…/tests/unit/promotion-readiness.test.ts
T
DongHyeonkaandClaude Opus 5.5 7f889a6d83 fix(release): record unobserved runbook drill verdicts as UNVERIFIED (11-01, 13-03)
Drills held constant true verdicts and read public/ placeholders, so they
passed with no build or with JS assets deleted. They now check the local dist,
mark boot, live traffic and provider steps UNVERIFIED (exit 3), and FE-GATE-016
is retired because it repeated FE-GATE-025's FE-RB-005 drill.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 22:15:59 +09:00

53 lines
1.5 KiB
TypeScript

import { describe, expect, it } from "vitest";
import {
evaluatePromotionReadiness,
PROMOTION_FORMULA,
} from "../../scripts/lib/promotion-readiness.ts";
const allGateIds = Object.values(PROMOTION_FORMULA).flat();
type GateResults = Parameters<typeof evaluatePromotionReadiness>[0];
const passing: GateResults = Object.fromEntries(
allGateIds.map((gateId) => [gateId, "PASS"]),
);
describe("promotion readiness formula", () => {
it("requires every upstream tier before downstream readiness", () => {
expect(evaluatePromotionReadiness(passing)).toEqual({
MERGE_READY: true,
RELEASE_READY: true,
PROD_PROMOTION_READY: true,
FIELD_SLO_READY: true,
DOCUMENTATION_READY: true,
});
});
it.each([
["FE-GATE-001", "MERGE_READY"],
["FE-GATE-012", "RELEASE_READY"],
["FE-GATE-021", "PROD_PROMOTION_READY"],
["FE-GATE-018", "FIELD_SLO_READY"],
["FE-GATE-017", "DOCUMENTATION_READY"],
] as const)("fails closed when %s fails", (failedGate, readiness) => {
const result = evaluatePromotionReadiness({
...passing,
[failedGate]: "FAIL",
});
expect(result[readiness]).toBe(false);
});
it("does not treat missing or unverified gates as pass", () => {
expect(
evaluatePromotionReadiness({
...passing,
"FE-GATE-009": "UNVERIFIED",
}),
).toMatchObject({
MERGE_READY: false,
RELEASE_READY: false,
PROD_PROMOTION_READY: false,
FIELD_SLO_READY: false,
});
});
});