diff --git a/src/auto-reply/reply/commands-models.test.ts b/src/auto-reply/reply/commands-models.test.ts index 9267fce4ac7..f2a4d0c948e 100644 --- a/src/auto-reply/reply/commands-models.test.ts +++ b/src/auto-reply/reply/commands-models.test.ts @@ -186,9 +186,8 @@ describe("handleModelsCommand", () => { expect(result?.reply?.text).toContain("Use: /models "); expect(result?.reply?.text).toContain("Switch: /model "); expect(result?.reply?.text).not.toContain("Add: /models add"); - expect(modelProviderAuthMocks.createProviderAuthChecker).toHaveBeenCalledWith( - expect.objectContaining({ workspaceDir: "/tmp" }), - ); + const authCheckerParams = modelProviderAuthMocks.createProviderAuthChecker.mock.calls[0]?.[0]; + expect(authCheckerParams?.workspaceDir).toBe("/tmp"); }); it("hides unauthenticated providers by default and keeps all as explicit browse", async () => { @@ -391,12 +390,9 @@ describe("handleModelsCommand", () => { const result = await handleModelsCommand(params, true); expect(result?.reply?.text).toContain("Models (anthropic ยท ๐Ÿ”‘ target-auth) โ€” showing 1-2 of 2"); - expect(modelAuthLabelMocks.resolveModelAuthLabel).toHaveBeenCalledWith( - expect.objectContaining({ - provider: "anthropic", - workspaceDir: "/tmp", - }), - ); + const authLabelParams = modelAuthLabelMocks.resolveModelAuthLabel.mock.calls[0]?.[0]; + expect(authLabelParams?.provider).toBe("anthropic"); + expect(authLabelParams?.workspaceDir).toBe("/tmp"); }); it("uses spawned workspace for direct /models provider visibility", async () => { @@ -414,9 +410,8 @@ describe("handleModelsCommand", () => { const result = await handleModelsCommand(params, true); expect(result?.reply?.text).toContain("- anthropic (2)"); - expect(modelProviderAuthMocks.createProviderAuthChecker).toHaveBeenCalledWith( - expect.objectContaining({ workspaceDir: "/tmp/spawned-workspace" }), - ); + const authCheckerParams = modelProviderAuthMocks.createProviderAuthChecker.mock.calls[0]?.[0]; + expect(authCheckerParams?.workspaceDir).toBe("/tmp/spawned-workspace"); }); it("returns a deprecation message for /models add when no provider is given", async () => {