Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

test(desktop): make launch-fence link fixtures work without Windows elevation

Lizi1d2b4fb84d6f
diff --git a/apps/desktop/src/main/__tests__/worktreePiSubagentReferences.test.ts b/apps/desktop/src/main/__tests__/worktreePiSubagentReferences.test.ts
index 860c590ac7..5f290bdb63 100644
--- a/apps/desktop/src/main/__tests__/worktreePiSubagentReferences.test.ts
+++ b/apps/desktop/src/main/__tests__/worktreePiSubagentReferences.test.ts
@@ -139,10 +139,16 @@ describe('detached Pi Subagent worktree references', () => {
await fs.mkdir(entry);
} else {
const target = path.join(state.root, 'link-target');
- await fs.writeFile(target, '{}');
- await fs.symlink(target, entry, process.platform === 'win32' ? 'file' : undefined);
+ if (process.platform === 'win32') await fs.mkdir(target);
+ else await fs.writeFile(target, '{}');
+ // Junctions exercise the same lstat link guard without requiring Windows symlink privileges.
+ await fs.symlink(target, entry, process.platform === 'win32' ? 'junction' : undefined);
+ expect((await fs.lstat(entry)).isSymbolicLink()).toBe(true);
}
+ const followingStat = vi.spyOn(fs, 'stat');
expect(await livePaths()).toBeNull();
+ // A directory junction must not hide a regression that follows the entry before rejecting it.
+ expect(followingStat.mock.calls.some(([target]) => target === entry)).toBe(false);
});
it.each(['notes.txt', '.launch-fence-backup.json', '.launch-fence-.json'])(