mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-10-04 14:52:06 +00:00
26 lines
1.1 KiB
TypeScript
26 lines
1.1 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { WO_TABLE_COLS } from "@/app/(protected)/workorders/_components/list/table/wo-table-cols";
|
|
import { expandScalarBoardOps } from "@/domain/work-orders/mappers/expand-scalar-board-ops";
|
|
import { mapWorkOrderTableRow } from "@/domain/work-orders/mappers/work-order-table-row-mapper";
|
|
|
|
describe("COMPLETED DATE board column wiring", () => {
|
|
it("includes COMPLETED DATE column after COMP DOC", () => {
|
|
const keys = WO_TABLE_COLS.map((col) => col.key);
|
|
expect(keys).toContain("completed");
|
|
expect(keys.indexOf("completed")).toBeGreaterThan(keys.indexOf("doc"));
|
|
});
|
|
|
|
it("expands completedDate patch to board field op", () => {
|
|
const ops = expandScalarBoardOps({ completedDate: "2026-07-30" });
|
|
expect(ops).toEqual([{ field: "completedDate", value: "2026-07-30" }]);
|
|
});
|
|
|
|
it("maps completedDate returned by a board GET row", () => {
|
|
const row = mapWorkOrderTableRow({
|
|
id: 42,
|
|
completedDate: "2026-07-30T00:00:00Z",
|
|
});
|
|
|
|
expect(row.completedDate).toBe("2026-07-30");
|
|
});
|
|
});
|