refactor(test): dedupe setup wizard helpers

This commit is contained in:
Peter Steinberger
2026-03-22 00:15:51 +00:00
parent 85722d4cf2
commit 30ad059da8
27 changed files with 322 additions and 186 deletions

View File

@@ -1,4 +1,5 @@
import { describe, expect, it } from "vitest";
import { runSetupWizardFinalize } from "../../test/helpers/extensions/setup-wizard.js";
import { createOptionalChannelSetupSurface } from "./channel-setup.js";
describe("createOptionalChannelSetupSurface", () => {
@@ -21,17 +22,13 @@ describe("createOptionalChannelSetupSurface", () => {
expect(setup.setupWizard.channel).toBe("example");
expect(setup.setupWizard.status.unconfiguredHint).toContain("/channels/example");
await expect(
setup.setupWizard.finalize?.({
cfg: {},
accountId: "default",
credentialValues: {},
runSetupWizardFinalize({
finalize: setup.setupWizard.finalize,
runtime: {
log: () => {},
error: () => {},
exit: async () => {},
},
prompter: {} as never,
forceAllowFrom: false,
}),
).rejects.toThrow("@openclaw/example");
});