fix(config-profiles): synchronize shared mount working copies
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.
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
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 } },
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user