import { describe, expect, it } from "vitest"; import { isDispatchLocked } from "@/domain/work-orders/utils/is-dispatch-locked"; describe("isDispatchLocked", () => { it("returns true when dispatch has verifiedAt timestamp", () => { expect(isDispatchLocked({ verifiedAt: "2026-02-01T10:00:00Z", status: "In Progress" })).toBe( true, ); }); it("returns true when dispatch status is Verified", () => { expect(isDispatchLocked({ verifiedAt: null, status: "Verified" })).toBe(true); }); it("returns true when dispatch status is Cancelled", () => { expect(isDispatchLocked({ verifiedAt: null, status: "Cancelled" })).toBe(true); }); it("returns false for active dispatch", () => { expect(isDispatchLocked({ verifiedAt: null, status: "Sent" })).toBe(false); }); });