mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 11:34:59 +00:00
refactor(test): reduce auth and channel setup duplication
This commit is contained in:
@@ -1,12 +1,5 @@
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
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";
|
||||
import { setActivePluginRegistry } from "../plugins/runtime.js";
|
||||
import { createTestRegistry } from "../test-utils/channel-plugins.js";
|
||||
import { setDefaultChannelPluginRegistryForTests } from "./channel-test-helpers.js";
|
||||
import { baseConfigSnapshot, createTestRuntime } from "./test-runtime-config-helpers.js";
|
||||
|
||||
const configMocks = vi.hoisted(() => ({
|
||||
@@ -56,16 +49,7 @@ describe("channels command", () => {
|
||||
version: 1,
|
||||
profiles: {},
|
||||
});
|
||||
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" },
|
||||
]),
|
||||
);
|
||||
setDefaultChannelPluginRegistryForTests();
|
||||
});
|
||||
|
||||
it("adds a non-default telegram account", async () => {
|
||||
|
||||
Reference in New Issue
Block a user