From b50d2ce93cf06acd031d18bd61966253a6d8f714 Mon Sep 17 00:00:00 2001 From: joshavant <830519+joshavant@users.noreply.github.com> Date: Tue, 24 Feb 2026 15:19:14 -0600 Subject: [PATCH] Tests: align auth-choice helper expectations with secret mode --- src/commands/auth-choice.apply-helpers.test.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/commands/auth-choice.apply-helpers.test.ts b/src/commands/auth-choice.apply-helpers.test.ts index c122fe197..b4b1c5feb 100644 --- a/src/commands/auth-choice.apply-helpers.test.ts +++ b/src/commands/auth-choice.apply-helpers.test.ts @@ -90,7 +90,7 @@ describe("maybeApplyApiKeyFromOption", () => { }); expect(result).toBe("opt-key"); - expect(setCredential).toHaveBeenCalledWith("opt-key"); + expect(setCredential).toHaveBeenCalledWith("opt-key", undefined); }); it("matches provider with whitespace/case normalization", async () => { @@ -105,7 +105,7 @@ describe("maybeApplyApiKeyFromOption", () => { }); expect(result).toBe("opt-key"); - expect(setCredential).toHaveBeenCalledWith("opt-key"); + expect(setCredential).toHaveBeenCalledWith("opt-key", undefined); }); it("skips when provider does not match", async () => { @@ -132,7 +132,7 @@ describe("ensureApiKeyFromEnvOrPrompt", () => { }); expect(result).toBe("env-key"); - expect(setCredential).toHaveBeenCalledWith("env-key"); + expect(setCredential).toHaveBeenCalledWith("env-key", "plaintext"); expect(text).not.toHaveBeenCalled(); }); @@ -143,7 +143,7 @@ describe("ensureApiKeyFromEnvOrPrompt", () => { }); expect(result).toBe("prompted-key"); - expect(setCredential).toHaveBeenCalledWith("prompted-key"); + expect(setCredential).toHaveBeenCalledWith("prompted-key", undefined); expect(text).toHaveBeenCalledWith( expect.objectContaining({ message: "Enter key", @@ -176,7 +176,7 @@ describe("ensureApiKeyFromOptionEnvOrPrompt", () => { }); expect(result).toBe("opts-key"); - expect(setCredential).toHaveBeenCalledWith("opts-key"); + expect(setCredential).toHaveBeenCalledWith("opts-key", undefined); expect(note).not.toHaveBeenCalled(); expect(confirm).not.toHaveBeenCalled(); expect(text).not.toHaveBeenCalled(); @@ -211,6 +211,6 @@ describe("ensureApiKeyFromOptionEnvOrPrompt", () => { expect(note).toHaveBeenCalledWith("MiniMax note", "MiniMax"); expect(confirm).toHaveBeenCalled(); expect(text).not.toHaveBeenCalled(); - expect(setCredential).toHaveBeenCalledWith("env-key"); + expect(setCredential).toHaveBeenCalledWith("env-key", "plaintext"); }); });