mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-10-03 02:13:22 +00:00
test(work-orders): keep Verified and Completed as live company assignment (SH-183)
Cancelled/Canceled/Refused stay inactive; verified or completed dispatches still gate Complete on the vendor that did the work.
This commit is contained in:
parent
b3899d2a51
commit
854267e213
1 changed files with 23 additions and 0 deletions
|
|
@ -349,6 +349,29 @@ describe("detailToClosabilityInput", () => {
|
|||
},
|
||||
);
|
||||
|
||||
it.each(["Verified", "Completed", "Sent"])(
|
||||
"treats dispatch status %s as a live company assignment (SH-183)",
|
||||
(status) => {
|
||||
const liveAssignment = {
|
||||
assignedTo: "Alice",
|
||||
completedDate: "2026-07-15",
|
||||
workOrderNumber: "20260623001",
|
||||
internalWONumber: "SH-1",
|
||||
problem: "HVAC PM",
|
||||
source: "procurement-integration",
|
||||
type: "",
|
||||
docStatus: "",
|
||||
mediaCount: 0,
|
||||
dispatches: [{ vendorName: "ACME Tech", vendorId: 45, status }],
|
||||
} as WorkOrderDetail;
|
||||
|
||||
const input = detailToClosabilityInput(liveAssignment);
|
||||
expect(input.company).toBe("ACME Tech");
|
||||
expect(input.vendorId).toBe("45");
|
||||
expect(getClosabilityGaps(input)).toEqual([]);
|
||||
},
|
||||
);
|
||||
|
||||
it("uses the active dispatch after an inactive cancelled spelling (SH-183)", () => {
|
||||
const supersededThenCurrent = {
|
||||
assignedTo: "Alice",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue