refactor(test): share onboarding and model auth test helpers

This commit is contained in:
Peter Steinberger
2026-02-16 16:48:36 +00:00
parent ac5f6e7c9d
commit 2d8edf85ad
10 changed files with 253 additions and 244 deletions

View File

@@ -235,13 +235,10 @@ describe("applyAuthChoice", () => {
}
return "default";
});
const multiselect: WizardPrompter["multiselect"] = vi.fn(async () => []);
const prompter = createPrompter({
const { prompter, runtime } = createApiKeyPromptHarness({
select: select as WizardPrompter["select"],
multiselect,
text,
});
const runtime = createExitThrowingRuntime();
const result = await applyAuthChoice({
authChoice: "zai-api-key",
@@ -265,13 +262,10 @@ describe("applyAuthChoice", () => {
const text = vi.fn().mockResolvedValue("zai-test-key");
const select = vi.fn(async () => "default");
const multiselect: WizardPrompter["multiselect"] = vi.fn(async () => []);
const prompter = createPrompter({
const { prompter, runtime } = createApiKeyPromptHarness({
select: select as WizardPrompter["select"],
multiselect,
text,
});
const runtime = createExitThrowingRuntime();
const result = await applyAuthChoice({
authChoice: "zai-coding-global",