This commit was merged in pull request #68.
This commit is contained in:
@@ -52,6 +52,44 @@ describe("extractReplacement", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("runEditTurn macOS automation prompt (#59)", () => {
|
||||
// The claude-code provider spawns the bundled `claude` CLI, which on macOS
|
||||
// performs IDE auto-connect when launched inside VS Code — sending Apple Events
|
||||
// that raise the "control other applications" prompt. The extension only
|
||||
// consumes the text result and never needs that connection, so we disable it.
|
||||
it("spawns the agent with IDE auto-connect + auto-install disabled, preserving the rest of the environment", async () => {
|
||||
vi.resetModules();
|
||||
const cfgs: any[] = [];
|
||||
vi.doMock("@cline/sdk", () => ({
|
||||
Agent: class {
|
||||
constructor(cfg: any) {
|
||||
cfgs.push(cfg);
|
||||
}
|
||||
subscribe() {
|
||||
return () => {};
|
||||
}
|
||||
abort() {}
|
||||
async run() {
|
||||
return { status: "completed", outputText: "X", runId: "r" };
|
||||
}
|
||||
},
|
||||
}));
|
||||
process.env.__WGL_TEST_SENTINEL__ = "keep-me";
|
||||
await runEditTurn("do it", "old");
|
||||
const cfg = cfgs[0];
|
||||
// mK("0") === true in the claude binary → hard-disables IDE auto-connect,
|
||||
// so no osascript / Apple Event fires.
|
||||
expect(cfg.options?.env?.CLAUDE_CODE_AUTO_CONNECT_IDE).toBe("0");
|
||||
// Belt-and-suspenders: skip the IDE-extension auto-install (deep-link path).
|
||||
expect(cfg.options?.env?.CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL).toBe("1");
|
||||
// The full process environment must survive (login under HOME, proxy/CA vars).
|
||||
expect(cfg.options?.env?.__WGL_TEST_SENTINEL__).toBe("keep-me");
|
||||
delete process.env.__WGL_TEST_SENTINEL__;
|
||||
vi.doUnmock("@cline/sdk");
|
||||
vi.resetModules();
|
||||
});
|
||||
});
|
||||
|
||||
describe("runEditTurn progress + cancel", () => {
|
||||
it("emits progress snapshots and returns the replacement unchanged (INV-44)", async () => {
|
||||
vi.resetModules();
|
||||
|
||||
Reference in New Issue
Block a user