@@ -174,6 +174,10 @@ function buildParams(
|
174 | 174 | } as unknown as HandleCommandsParams; |
175 | 175 | } |
176 | 176 | |
| 177 | +function firstAuthCheckerParams() { |
| 178 | +return modelProviderAuthMocks.createProviderAuthChecker.mock.calls[0]?.[0]; |
| 179 | +} |
| 180 | + |
177 | 181 | describe("handleModelsCommand", () => { |
178 | 182 | it("shows a simple providers menu on text surfaces", async () => { |
179 | 183 | const result = await handleModelsCommand(buildParams("/models"), true); |
@@ -186,8 +190,7 @@ describe("handleModelsCommand", () => {
|
186 | 190 | expect(result?.reply?.text).toContain("Use: /models <provider>"); |
187 | 191 | expect(result?.reply?.text).toContain("Switch: /model <provider/model>"); |
188 | 192 | expect(result?.reply?.text).not.toContain("Add: /models add"); |
189 | | -const authCheckerParams = |
190 | | -modelProviderAuthMocks.createProviderAuthChecker.mock.calls.at(0)?.[0]; |
| 193 | +const authCheckerParams = firstAuthCheckerParams(); |
191 | 194 | expect(authCheckerParams?.workspaceDir).toBe("/tmp"); |
192 | 195 | }); |
193 | 196 | |
@@ -412,8 +415,7 @@ describe("handleModelsCommand", () => {
|
412 | 415 | const result = await handleModelsCommand(params, true); |
413 | 416 | |
414 | 417 | expect(result?.reply?.text).toContain("- anthropic (2)"); |
415 | | -const authCheckerParams = |
416 | | -modelProviderAuthMocks.createProviderAuthChecker.mock.calls.at(0)?.[0]; |
| 418 | +const authCheckerParams = firstAuthCheckerParams(); |
417 | 419 | expect(authCheckerParams?.workspaceDir).toBe("/tmp/spawned-workspace"); |
418 | 420 | }); |
419 | 421 | |
|