diff --git a/src/commands/auth-choice-legacy.test.ts b/src/commands/auth-choice-legacy.test.ts index ea838bd939c..e31f40ba441 100644 --- a/src/commands/auth-choice-legacy.test.ts +++ b/src/commands/auth-choice-legacy.test.ts @@ -1,4 +1,30 @@ -import { describe, expect, it } from "vitest"; +import { describe, expect, it, vi } from "vitest"; + +const manifestAuthChoices = vi.hoisted(() => [ + { + pluginId: "anthropic", + providerId: "anthropic", + methodId: "cli", + choiceId: "anthropic-cli", + choiceLabel: "Anthropic Claude CLI", + deprecatedChoiceIds: ["claude-cli"], + }, + { + pluginId: "openai", + providerId: "openai-codex", + methodId: "cli", + choiceId: "openai-codex-cli", + choiceLabel: "OpenAI Codex CLI", + deprecatedChoiceIds: ["codex-cli"], + }, +]); + +vi.mock("../plugins/provider-auth-choices.js", () => ({ + resolveManifestProviderAuthChoices: () => manifestAuthChoices, + resolveManifestDeprecatedProviderAuthChoice: (choiceId: string) => + manifestAuthChoices.find((choice) => choice.deprecatedChoiceIds.includes(choiceId)), +})); + import { resolveLegacyAuthChoiceAliasesForCli, formatDeprecatedNonInteractiveAuthChoiceError,