mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-10-07 16:19:01 +00:00
Board Clear uses empty-week patch; slide-over Save derives Pending via mergeAutoSchedulePatch.
33 lines
939 B
TypeScript
33 lines
939 B
TypeScript
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.",
|
|
});
|
|
});
|
|
});
|