refactor: migrate messaging plugins to sdk
This commit is contained in:
@@ -1,9 +1,17 @@
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
import type { ClawdbotConfig } from "../config/config.js";
|
||||
import type { RuntimeEnv } from "../runtime.js";
|
||||
import type { WizardPrompter } from "../wizard/prompts.js";
|
||||
import { setupChannels } from "./onboard-channels.js";
|
||||
import { setActivePluginRegistry } from "../plugins/runtime.js";
|
||||
import { createTestRegistry } from "../test-utils/channel-plugins.js";
|
||||
import { discordPlugin } from "../../extensions/discord/src/channel.js";
|
||||
import { imessagePlugin } from "../../extensions/imessage/src/channel.js";
|
||||
import { signalPlugin } from "../../extensions/signal/src/channel.js";
|
||||
import { slackPlugin } from "../../extensions/slack/src/channel.js";
|
||||
import { telegramPlugin } from "../../extensions/telegram/src/channel.js";
|
||||
import { whatsappPlugin } from "../../extensions/whatsapp/src/channel.js";
|
||||
|
||||
vi.mock("node:fs/promises", () => ({
|
||||
default: {
|
||||
@@ -22,6 +30,18 @@ vi.mock("./onboard-helpers.js", () => ({
|
||||
}));
|
||||
|
||||
describe("setupChannels", () => {
|
||||
beforeEach(() => {
|
||||
setActivePluginRegistry(
|
||||
createTestRegistry([
|
||||
{ pluginId: "discord", plugin: discordPlugin, source: "test" },
|
||||
{ pluginId: "slack", plugin: slackPlugin, source: "test" },
|
||||
{ pluginId: "telegram", plugin: telegramPlugin, source: "test" },
|
||||
{ pluginId: "whatsapp", plugin: whatsappPlugin, source: "test" },
|
||||
{ pluginId: "signal", plugin: signalPlugin, source: "test" },
|
||||
{ pluginId: "imessage", plugin: imessagePlugin, source: "test" },
|
||||
]),
|
||||
);
|
||||
});
|
||||
it("QuickStart uses single-select (no multiselect) and doesn't prompt for Telegram token when WhatsApp is chosen", async () => {
|
||||
const select = vi.fn(async () => "whatsapp");
|
||||
const multiselect = vi.fn(async () => {
|
||||
|
||||
Reference in New Issue
Block a user