refactor: expose plugin test helpers via sdk

This commit is contained in:
Peter Steinberger
2026-04-27 23:45:08 +01:00
parent 6f09039b0c
commit 0df6e5a473
126 changed files with 659 additions and 349 deletions

View File

@@ -1,4 +1,3 @@
import { afterEach, describe, expect, it, vi } from "vitest";
import {
createPluginSetupWizardAdapter,
createPluginSetupWizardStatus,
@@ -6,7 +5,8 @@ import {
promptSetupWizardAllowFrom,
runSetupWizardConfigure,
type WizardPrompter,
} from "../../../test/helpers/plugins/setup-wizard.js";
} from "openclaw/plugin-sdk/testing";
import { afterEach, describe, expect, it, vi } from "vitest";
import {
expectStopPendingUntilAbort,
startAccountAndTrackLifecycle,
@@ -409,15 +409,16 @@ describe("irc setup", () => {
},
};
const updated = (await promptSetupWizardAllowFrom({
const updated = await promptSetupWizardAllowFrom({
promptAllowFrom,
cfg,
prompter,
accountId: "work",
})) as CoreConfig;
});
expect(updated).toBeDefined();
expect(updated.channels?.irc?.allowFrom).toEqual(["alice", "bob!ident@example.org"]);
expect(updated.channels?.irc?.accounts?.work?.allowFrom).toBeUndefined();
expect(updated?.channels?.irc?.allowFrom).toEqual(["alice", "bob!ident@example.org"]);
expect(updated?.channels?.irc?.accounts?.work?.allowFrom).toBeUndefined();
});
it("keeps startAccount pending until abort, then stops the monitor", async () => {