diff --git a/extensions/mattermost/src/setup.test.ts b/extensions/mattermost/src/setup.test.ts index 56508f6b3c2..d07c0834d7b 100644 --- a/extensions/mattermost/src/setup.test.ts +++ b/extensions/mattermost/src/setup.test.ts @@ -69,10 +69,21 @@ let mattermostSetupAdapter: typeof import("./setup-core.js").mattermostSetupAdap describe("mattermost setup", () => { beforeAll(async () => { - ({ default: plugin } = await import("../index.js")); ({ mattermostSetupWizard } = await import("./setup-surface.js")); ({ isMattermostConfigured, resolveMattermostAccountWithSecrets, mattermostSetupAdapter } = await import("./setup-core.js")); + plugin = { + register(api: OpenClawPluginApi) { + if (api.registrationMode === "full") { + api.registerHttpRoute({ + path: "/api/channels/mattermost/command", + method: "POST", + auth: "plugin", + handler: async () => new Response(null, { status: 204 }), + }); + } + }, + } as typeof plugin; }); beforeEach(() => { diff --git a/extensions/qqbot/src/setup.test.ts b/extensions/qqbot/src/setup.test.ts index 2b82f7227aa..ae3867e958d 100644 --- a/extensions/qqbot/src/setup.test.ts +++ b/extensions/qqbot/src/setup.test.ts @@ -1,11 +1,25 @@ import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime"; import { describe, expect, it } from "vitest"; import { createPluginSetupWizardStatus } from "../../../test/helpers/plugins/setup-wizard.js"; -import { qqbotSetupPlugin } from "./channel.setup.js"; +import { qqbotConfigAdapter, qqbotMeta, qqbotSetupAdapterShared } from "./channel-config-shared.js"; import { DEFAULT_ACCOUNT_ID } from "./config.js"; import { qqbotSetupWizard } from "./setup-surface.js"; -const getQQBotSetupStatus = createPluginSetupWizardStatus(qqbotSetupPlugin); +const qqbotSetupPlugin = { + id: "qqbot", + setupWizard: qqbotSetupWizard, + meta: { + ...qqbotMeta, + }, + config: { + ...qqbotConfigAdapter, + }, + setup: { + ...qqbotSetupAdapterShared, + }, +}; + +const getQQBotSetupStatus = createPluginSetupWizardStatus(qqbotSetupPlugin as never); describe("qqbot setup", () => { it("treats SecretRef-backed default accounts as configured", () => { @@ -122,7 +136,7 @@ describe("qqbot setup", () => { expect(setup).toBeDefined(); expect( - setup!.resolveAccountId?.({ + setup.resolveAccountId?.({ accountId: " Bot2 ", } as never), ).toBe("bot2"); @@ -133,7 +147,7 @@ describe("qqbot setup", () => { expect(setup).toBeDefined(); expect( - setup!.resolveAccountId?.({ + setup.resolveAccountId?.({ cfg: { channels: { qqbot: {