mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:10:43 +00:00
test(codex): sync app-server model auth mock
This commit is contained in:
@@ -5,6 +5,7 @@ import { createClientHarness } from "./test-support.js";
|
||||
const mocks = vi.hoisted(() => {
|
||||
const authBridge = {
|
||||
applyAuthProfile: vi.fn(async () => undefined),
|
||||
authProfileId: vi.fn((params?: { authProfileId?: string }) => params?.authProfileId),
|
||||
startOptions: vi.fn(async ({ startOptions }) => startOptions),
|
||||
};
|
||||
const managedBinary = {
|
||||
@@ -19,6 +20,7 @@ const mocks = vi.hoisted(() => {
|
||||
vi.mock("./auth-bridge.js", () => ({
|
||||
applyCodexAppServerAuthProfile: mocks.authBridge.applyAuthProfile,
|
||||
bridgeCodexAppServerStartOptions: mocks.authBridge.startOptions,
|
||||
resolveCodexAppServerAuthProfileIdForAgent: mocks.authBridge.authProfileId,
|
||||
}));
|
||||
|
||||
vi.mock("./managed-binary.js", () => ({
|
||||
@@ -44,6 +46,10 @@ describe("listCodexAppServerModels", () => {
|
||||
resetSharedCodexAppServerClientForTests();
|
||||
vi.restoreAllMocks();
|
||||
mocks.authBridge.applyAuthProfile.mockClear();
|
||||
mocks.authBridge.authProfileId.mockClear();
|
||||
mocks.authBridge.authProfileId.mockImplementation(
|
||||
(params?: { authProfileId?: string }) => params?.authProfileId,
|
||||
);
|
||||
mocks.authBridge.startOptions.mockClear();
|
||||
mocks.managedBinary.startOptions.mockClear();
|
||||
mocks.managedBinary.startOptions.mockImplementation(async (startOptions) => startOptions);
|
||||
|
||||
Reference in New Issue
Block a user