feat(workbench): route actionable notifications
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { getOperationalNotificationRoute } from "./operational-notification-routing";
|
||||
|
||||
describe("getOperationalNotificationRoute", () => {
|
||||
it.each(["task_created", "report_updated", "task_completed"] as const)(
|
||||
"keeps normal lifecycle notification %s out of exception handling",
|
||||
(kind) => expect(getOperationalNotificationRoute(kind)).toBeNull()
|
||||
);
|
||||
|
||||
it("routes failures, approvals, human input, and external coordination", () => {
|
||||
expect(getOperationalNotificationRoute("task_failed")).toEqual({
|
||||
category: "task_exception",
|
||||
severity: "critical"
|
||||
});
|
||||
expect(getOperationalNotificationRoute("access_approval_pending")?.category)
|
||||
.toBe("human_approval");
|
||||
expect(getOperationalNotificationRoute("action_approval_pending")?.category)
|
||||
.toBe("human_approval");
|
||||
expect(getOperationalNotificationRoute("human_input_required")?.category)
|
||||
.toBe("human_input");
|
||||
expect(getOperationalNotificationRoute("external_coordination_failed")).toEqual({
|
||||
category: "external_coordination",
|
||||
severity: "critical"
|
||||
});
|
||||
});
|
||||
|
||||
it("keeps legacy action notifications visible during the database rollout", () => {
|
||||
expect(getOperationalNotificationRoute("action_pending")?.category)
|
||||
.toBe("human_approval");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user