fix(test): align board-core affordance fixtures with WorkOrderTableRow

This commit is contained in:
Arthur Bassi 2026-07-24 10:07:15 -03:00
parent c97d752dd6
commit 5e30c07c79

View file

@ -53,11 +53,42 @@ vi.mock("@/app/(protected)/workorders/_components/media/media-upload-modal", ()
MediaUploadModal: () => null,
}));
const canceledRow = {
const canceledRow: WorkOrderTableRow = {
id: 77,
status: "Canceled",
woNumber: "WO-77",
} as WorkOrderTableRow;
site: "CHI-1042",
type: "PM",
dispatcherId: "u1",
dispatcherName: "Test Dispatcher",
scheduledOn: "2026-07-20",
targetWeek: "2026-07-20",
dayGroup: "2026-07-20",
dayLabel: "Mon",
location: "Chicago Loop",
locationId: "mock-loc-1",
pm: "HVAC — Quarterly PM",
company: "",
tech: "",
techPhone: "",
apptStart: "",
apptEnd: "",
apptTime: "",
status: "Canceled",
docStatus: "No",
pocName: "",
pocPhone: "",
pocNotes: "",
dueDate: "",
rescheduleCount: 0,
carriedOver: 0,
originalWeek: "",
originalDate: "",
isPastDue: false,
scheduleWeekOnly: false,
mediaCount: 0,
title: "",
priority: "",
};
vi.mock("@/app/(protected)/workorders/_hooks/use-work-orders-table-data", () => ({
useWorkOrdersTableData: () => ({
@ -151,7 +182,7 @@ describe("WorkOrdersListPage board-core public interface", () => {
describe("CompDocCell slice affordances", () => {
it("hides View Doc / Draft when onOpen is omitted", () => {
const { container } = renderWithProviders(
<CompDocCell status="No" woType="Preventative" onOpenMedia={vi.fn()} />,
<CompDocCell status="No" woType="PM" onOpenMedia={vi.fn()} />,
{ withAuth: false },
);
@ -161,7 +192,7 @@ describe("CompDocCell slice affordances", () => {
it("shows View Doc when onOpen is provided", () => {
renderWithProviders(
<CompDocCell status="Yes" woType="Preventative" onOpen={vi.fn()} onOpenMedia={vi.fn()} />,
<CompDocCell status="Yes" woType="PM" onOpen={vi.fn()} onOpenMedia={vi.fn()} />,
{ withAuth: false },
);