2247ec47c9
Use canonical profile files and writable Git working copies so editor and container changes share one source. Require confirmation before destructive Git refreshes and overlay profile files without composite snapshots.
32 lines
785 B
TypeScript
32 lines
785 B
TypeScript
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
|
|
const mockPost = vi.fn();
|
|
|
|
vi.mock("./client", () => ({
|
|
apiClient: {
|
|
post: (...args: unknown[]) => mockPost(...args),
|
|
},
|
|
}));
|
|
|
|
import { refreshConfigProfileGitMounts } from "./config-profiles";
|
|
|
|
describe("refreshConfigProfileGitMounts", () => {
|
|
beforeEach(() => {
|
|
mockPost.mockReset();
|
|
});
|
|
|
|
it("confirms the destructive refresh at the API boundary", async () => {
|
|
mockPost.mockResolvedValue({ data: { refresh_outcomes: [] } });
|
|
|
|
await expect(refreshConfigProfileGitMounts("profile-1")).resolves.toEqual({
|
|
refresh_outcomes: [],
|
|
});
|
|
|
|
expect(mockPost).toHaveBeenCalledWith(
|
|
"/config-profiles/profile-1/refresh-git-mounts",
|
|
undefined,
|
|
{ params: { confirm_destructive_refresh: true } },
|
|
);
|
|
});
|
|
});
|