Files
kandev/apps/web/lib/utils/needs-action.test.ts
T
2026-09-09 21:46:28 +01:00

34 lines
876 B
TypeScript

import { describe, expect, it } from "vitest";
import { needsAction } from "./needs-action";
describe("needsAction", () => {
it("uses the task status summary when legacy pending data is stale", () => {
expect(
needsAction({
state: "REVIEW",
taskPendingAction: "clarification",
statusSummary: { pending_action: "permission" },
}),
).toBe(true);
});
it("recognizes a pending action when the task remains in REVIEW", () => {
expect(
needsAction({
state: "REVIEW",
statusSummary: { pending_action: "clarification" },
}),
).toBe(true);
});
it("does not revive a legacy action after the status summary clears it", () => {
expect(
needsAction({
state: "REVIEW",
taskPendingAction: "clarification",
statusSummary: {},
}),
).toBe(false);
});
});