The best way to control Claude Code, Codex and more from any computer or phone
test(desktop): cover password store through startup (#10287)
Julius Marminge committed
Sep 5, 2026 at 22:12 UTC
181e45110f2d14950a5c1ec415faf3a049cb9b2e
2 files changed
+16
-39
apps/desktop/src/app/DesktopPreReadyPlatform.test.ts
+15
-38
@@ -37,45 +37,22 @@ describe("DesktopPreReadyPlatform", () => {
37
registerSchemesMock.mockReset();
38
});
39
40
- it("reads an explicit Electron command-line switch value", () => {
41
- const value = DesktopPreReadyPlatform.readCommandLineSwitchValue(
42
- {
43
- hasSwitch: (switchName) => switchName === "password-store",
44
- getSwitchValue: (switchName) => {
45
- assert.equal(switchName, "password-store");
46
- return "basic";
47
- },
48
- },
49
- "password-store",
40
+ it.effect("preserves an explicit Linux password-store switch", () => {
41
+ hasSwitchMock.mockImplementation((switchName) => switchName === "password-store");
42
+ getSwitchValueMock.mockReturnValue(" basic ");
43
+
44
+ return Effect.gen(function* () {
45
+ const options = yield* DesktopPreReadyPlatform.DesktopPreReadyElectronOptions;
46
+
47
+ assert.equal(options.linuxPasswordStoreCommandLine, "basic");
48
+ assert.isFalse(appendSwitchMock.mock.calls.some(([name]) => name === "password-store"));
49
+ }).pipe(
50
+ Effect.provide(
51
+ DesktopPreReadyPlatform.layer.pipe(
52
+ Layer.provide(Layer.succeed(HostProcessPlatform, "linux")),
53
+ ),
54
+ ),
55
);
51
-
52
- assert.equal(value, "basic");
53
- });
54
-
55
- it("treats valueless Electron command-line switches as absent", () => {
56
- const value = DesktopPreReadyPlatform.readCommandLineSwitchValue(
57
- {
58
- hasSwitch: () => true,
59
- getSwitchValue: () => "",
60
- },
61
- "password-store",
62
- );
63
-
64
- assert.isNull(value);
65
- });
66
-
67
- it("returns null for missing Electron command-line switches", () => {
68
- const value = DesktopPreReadyPlatform.readCommandLineSwitchValue(
69
- {
70
- hasSwitch: () => false,
71
- getSwitchValue: () => {
72
- throw new Error("Unexpected switch value read.");
73
- },
74
- },
75
- "password-store",
76
- );
77
-
78
- assert.isNull(value);
56
});
57
58
it.effect(
apps/desktop/src/app/DesktopPreReadyPlatform.ts
+1
-1
@@ -17,7 +17,7 @@ export interface DesktopPreReadyCommandLineReader {
17
readonly getSwitchValue: (switchName: string) => string;
18
}
19
20
-export function readCommandLineSwitchValue(
20
+function readCommandLineSwitchValue(
21
commandLine: DesktopPreReadyCommandLineReader,
22
switchName: string,
23
): string | null {