mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 11:04:59 +00:00
refactor(test-utils): share direct channel plugin test fixture
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { listChannelPlugins } from "../../channels/plugins/index.js";
|
||||
import type { ChannelPlugin } from "../../channels/plugins/types.js";
|
||||
import { makeDirectPlugin } from "../../test-utils/channel-plugin-test-fixtures.js";
|
||||
import { buildChannelsTable } from "./channels.js";
|
||||
|
||||
vi.mock("../../channels/plugins/index.js", () => ({
|
||||
@@ -116,29 +117,6 @@ function makeUnavailableSlackPlugin(): ChannelPlugin {
|
||||
};
|
||||
}
|
||||
|
||||
function makeDirectPlugin(params: {
|
||||
id: string;
|
||||
label: string;
|
||||
docsPath: string;
|
||||
config: ChannelPlugin["config"];
|
||||
}): ChannelPlugin {
|
||||
return {
|
||||
id: params.id,
|
||||
meta: {
|
||||
id: params.id,
|
||||
label: params.label,
|
||||
selectionLabel: params.label,
|
||||
docsPath: params.docsPath,
|
||||
blurb: "test",
|
||||
},
|
||||
capabilities: { chatTypes: ["direct"] },
|
||||
config: params.config,
|
||||
actions: {
|
||||
listActions: () => ["send"],
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
function makeSourceAwareUnavailablePlugin(): ChannelPlugin {
|
||||
return makeDirectPlugin({
|
||||
id: "slack",
|
||||
|
||||
Reference in New Issue
Block a user