Skip to content

Commit ae9fdec

Browse files
Yash-Singh1claude
andcommitted
test(server): cover the Cursor Keychain timeout message
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent adb2851 commit ae9fdec

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { assert, describe, it } from "@effect/vitest";
2+
3+
import { CursorKeychainTimeoutError } from "../provider/cursorCredentialStore.ts";
4+
import { readCursorAccountUsage } from "./cursorUsageReader.ts";
5+
6+
describe("readCursorAccountUsage", () => {
7+
it("asks for Keychain approval when the prompt goes unanswered", async () => {
8+
const result = await readCursorAccountUsage(
9+
{ kind: "keychain" },
10+
0,
11+
1,
12+
() => Promise.reject(new Error("no network expected")),
13+
() => Promise.reject(new CursorKeychainTimeoutError()),
14+
);
15+
assert.deepStrictEqual(result, {
16+
accountKey: null,
17+
records: [],
18+
missing: false,
19+
error: "Allow Keychain access on the Mac running T3 Code, then refresh.",
20+
});
21+
});
22+
});

0 commit comments

Comments
 (0)