import { beforeEach, describe, expect, it, vi } from "vitest"; import { weekMoveNotify } from "@/app/(protected)/workorders/_components/list/table/reschedule-notify"; const { toast } = vi.hoisted(() => { const notify = Object.assign( vi.fn((_content: unknown, _options?: unknown) => 1), { dismiss: vi.fn(), }, ); return { toast: notify }; }); vi.mock("react-toastify", () => ({ toast })); describe("weekMoveNotify", () => { beforeEach(() => { toast.mockClear(); toast.dismiss.mockClear(); }); it("uses the AAP Unscheduled message and Advanced Filters action when clearing", () => { weekMoveNotify("", { onNavigate: vi.fn() }); const content = toast.mock.calls[0][0] as { props: { message: string; linkLabel: string }; }; expect(content.props).toMatchObject({ message: "Work order moved to Unscheduled.", linkLabel: "View in Advanced Filters.", }); }); });