test(codex): sync app-server model auth mock

This commit is contained in:
Vincent Koc
2026-05-03 18:55:51 -07:00
parent 7b29fc36c3
commit 1fe2b8b548

View File

@@ -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);