forked from farhoodlabs/paperclip
[codex] Add runtime lifecycle recovery and live issue visibility (#4419)
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
const mockApi = vi.hoisted(() => ({
|
||||
get: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock("./client", () => ({
|
||||
api: mockApi,
|
||||
}));
|
||||
|
||||
import { heartbeatsApi } from "./heartbeats";
|
||||
|
||||
describe("heartbeatsApi.liveRunsForCompany", () => {
|
||||
beforeEach(() => {
|
||||
mockApi.get.mockReset();
|
||||
mockApi.get.mockResolvedValue([]);
|
||||
});
|
||||
|
||||
it("keeps the legacy numeric minCount signature", async () => {
|
||||
await heartbeatsApi.liveRunsForCompany("company-1", 4);
|
||||
|
||||
expect(mockApi.get).toHaveBeenCalledWith("/companies/company-1/live-runs?minCount=4");
|
||||
});
|
||||
|
||||
it("passes minCount and limit options to the company live-runs endpoint", async () => {
|
||||
await heartbeatsApi.liveRunsForCompany("company-1", { minCount: 50, limit: 50 });
|
||||
|
||||
expect(mockApi.get).toHaveBeenCalledWith("/companies/company-1/live-runs?minCount=50&limit=50");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user