refactor(test): dedupe setup wizard test helpers

This commit is contained in:
Peter Steinberger
2026-03-21 23:29:02 +00:00
parent 6266b842d4
commit 57fa59ab92
13 changed files with 222 additions and 271 deletions

View File

@@ -5,9 +5,9 @@ import {
resolveDefaultLineAccountId,
resolveLineAccount,
} from "../../../src/line/accounts.js";
import { createRuntimeEnv } from "../../../test/helpers/extensions/runtime-env.js";
import {
createTestWizardPrompter,
runSetupWizardConfigure,
type WizardPrompter,
} from "../../../test/helpers/extensions/setup-wizard.js";
import type { OpenClawConfig } from "../api.js";
@@ -42,14 +42,11 @@ describe("line setup wizard", () => {
}) as WizardPrompter["text"],
});
const result = await lineConfigureAdapter.configure({
const result = await runSetupWizardConfigure({
configure: lineConfigureAdapter.configure,
cfg: {} as OpenClawConfig,
runtime: createRuntimeEnv(),
prompter,
options: {},
accountOverrides: {},
shouldPromptAccountIds: false,
forceAllowFrom: false,
});
expect(result.accountId).toBe("default");