import { describe, expect, it, vi } from "vitest"; import type { HttpInvoker } from "./httpInvoker"; import { HttpScheduledTaskGateway } from "./requestResponseGateways"; describe("HttpScheduledTaskGateway", () => { it("forwards the shared HTTP command contract", async () => { const invoke = vi.fn().mockResolvedValue([]); const gateway = new HttpScheduledTaskGateway({ invoke } as unknown as HttpInvoker); await gateway.list("project-1"); await gateway.setEnabled("project-1", "schedule-1", true); expect(invoke).toHaveBeenNthCalledWith(1, "list_scheduled_project_tasks", { projectId: "project-1" }); expect(invoke).toHaveBeenNthCalledWith(2, "set_scheduled_project_task_enabled", { projectId: "project-1", scheduledTaskId: "schedule-1", enabled: true, }); }); });