Files
next-tjwater-frontend/src/features/workbench/utils/operational-notification-routing.test.ts
T

23 lines
1.2 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { getOperationalNotificationSeverity } from "./operational-notification-routing";
describe("getOperationalNotificationSeverity", () => {
it.each(["task_created", "report_updated", "task_completed"] as const)(
"keeps normal lifecycle notification %s out of exception handling",
(kind) => expect(getOperationalNotificationSeverity(kind)).toBeNull()
);
it("maps actionable notifications to their displayed severity", () => {
expect(getOperationalNotificationSeverity("task_failed")).toBe("critical");
expect(getOperationalNotificationSeverity("run_delivery_degraded")).toBe("critical");
expect(getOperationalNotificationSeverity("access_approval_pending")).toBe("warning");
expect(getOperationalNotificationSeverity("action_approval_pending")).toBe("warning");
expect(getOperationalNotificationSeverity("human_input_required")).toBe("warning");
expect(getOperationalNotificationSeverity("external_coordination_failed")).toBe("critical");
});
it("keeps legacy action notifications visible during the database rollout", () => {
expect(getOperationalNotificationSeverity("action_pending")).toBe("warning");
});
});