test(codex): sync app-server model auth mock · openclaw/openclaw@1fe2b8b
vincentkoc
·
2026-05-04
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -5,6 +5,7 @@ import { createClientHarness } from "./test-support.js";
|
5 | 5 | const mocks = vi.hoisted(() => { |
6 | 6 | const authBridge = { |
7 | 7 | applyAuthProfile: vi.fn(async () => undefined), |
| 8 | +authProfileId: vi.fn((params?: { authProfileId?: string }) => params?.authProfileId), |
8 | 9 | startOptions: vi.fn(async ({ startOptions }) => startOptions), |
9 | 10 | }; |
10 | 11 | const managedBinary = { |
@@ -19,6 +20,7 @@ const mocks = vi.hoisted(() => {
|
19 | 20 | vi.mock("./auth-bridge.js", () => ({ |
20 | 21 | applyCodexAppServerAuthProfile: mocks.authBridge.applyAuthProfile, |
21 | 22 | bridgeCodexAppServerStartOptions: mocks.authBridge.startOptions, |
| 23 | +resolveCodexAppServerAuthProfileIdForAgent: mocks.authBridge.authProfileId, |
22 | 24 | })); |
23 | 25 | |
24 | 26 | vi.mock("./managed-binary.js", () => ({ |
@@ -44,6 +46,10 @@ describe("listCodexAppServerModels", () => {
|
44 | 46 | resetSharedCodexAppServerClientForTests(); |
45 | 47 | vi.restoreAllMocks(); |
46 | 48 | mocks.authBridge.applyAuthProfile.mockClear(); |
| 49 | +mocks.authBridge.authProfileId.mockClear(); |
| 50 | +mocks.authBridge.authProfileId.mockImplementation( |
| 51 | +(params?: { authProfileId?: string }) => params?.authProfileId, |
| 52 | +); |
47 | 53 | mocks.authBridge.startOptions.mockClear(); |
48 | 54 | mocks.managedBinary.startOptions.mockClear(); |
49 | 55 | mocks.managedBinary.startOptions.mockImplementation(async (startOptions) => startOptions); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。