Files
kandev/apps/web/lib/api/domains/github-pr-api.test.ts
T
João Salavisa ad21460007 feat(github): add merge queue actions (#2755)
Co-authored-by: Kandev Agent <agent@kandev.dev>
2026-08-17 23:28:59 +00:00

29 lines
649 B
TypeScript

import { afterEach, expect, it, vi } from "vitest";
vi.mock("@/lib/config", () => ({
getBackendConfig: () => ({ apiBaseUrl: "http://api.test" }),
}));
import { mergePR } from "./github-api";
afterEach(() => {
vi.unstubAllGlobals();
});
it("returns the queue-aware merge outcome", async () => {
vi.stubGlobal(
"fetch",
vi.fn(
async () =>
new Response(JSON.stringify({ status: "queued" }), {
status: 200,
headers: { "Content-Type": "application/json" },
}),
),
);
await expect(mergePR("workspace-1", "acme", "site", 42, "squash")).resolves.toEqual({
status: "queued",
});
});