fix(coding-agent): bootstrap profiles for acp
This commit is contained in:
@@ -178,6 +178,32 @@ describe("global --profile flag", () => {
|
||||
expect(output).not.toContain(`${APP_NAME}/${VERSION}`);
|
||||
});
|
||||
|
||||
it("installs a shell alias when acp is explicit", async () => {
|
||||
const installSpy = vi.spyOn(profileAliasCli, "installProfileAlias").mockResolvedValue({
|
||||
shell: "bash",
|
||||
configPath: "/home/me/.bashrc",
|
||||
aliasName: "omp-work",
|
||||
profile: "work",
|
||||
command: "omp --profile=work",
|
||||
reloadedWith: ". '/home/me/.bashrc'",
|
||||
});
|
||||
const outSpy = vi.spyOn(process.stdout, "write").mockImplementation(() => true);
|
||||
|
||||
await runCli(["acp", "--profile", "work", "--alias", "omp-work", "--version"]);
|
||||
|
||||
expect(process.exitCode).toBe(0);
|
||||
expect(installSpy).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
profile: "work",
|
||||
aliasName: "omp-work",
|
||||
}),
|
||||
);
|
||||
expect(getActiveProfile()).toBe("work");
|
||||
const output = outSpy.mock.calls.map(call => String(call[0] ?? "")).join("\n");
|
||||
expect(output).toContain("Created omp-work");
|
||||
expect(output).not.toContain(`${APP_NAME}/${VERSION}`);
|
||||
});
|
||||
|
||||
it("rejects missing profile values without dispatching", async () => {
|
||||
const errSpy = vi.spyOn(process.stderr, "write").mockImplementation(() => true);
|
||||
const outSpy = vi.spyOn(process.stdout, "write").mockImplementation(() => true);
|
||||
|
||||
Reference in New Issue
Block a user