refactor(workbench): clarify report states

This commit is contained in:
2026-07-13 15:43:07 +08:00
parent 3a44de941d
commit c2e1c937ae
5 changed files with 295 additions and 252 deletions
@@ -0,0 +1,16 @@
import { describe, expect, it } from "vitest";
import { getConditionReportRiskLevel } from "./condition-report-risk";
describe("getConditionReportRiskLevel", () => {
it("maps error and warning statuses to their operational risk levels", () => {
expect(getConditionReportRiskLevel("error", "normal")).toBe("critical");
expect(getConditionReportRiskLevel("warning", "normal")).toBe("attention");
});
it("preserves the explicit risk level for lifecycle-only statuses", () => {
expect(getConditionReportRiskLevel("completed", "normal")).toBe("normal");
expect(getConditionReportRiskLevel("completed", "attention")).toBe("attention");
expect(getConditionReportRiskLevel("running", "critical")).toBe("critical");
});
});