mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 20:40:43 +00:00
test: keep command registry native overrides hermetic
This commit is contained in:
21
extensions/discord/src/shared.test.ts
Normal file
21
extensions/discord/src/shared.test.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { createDiscordPluginBase } from "./shared.js";
|
||||
|
||||
describe("createDiscordPluginBase", () => {
|
||||
it("owns Discord native command name overrides", () => {
|
||||
const plugin = createDiscordPluginBase({ setup: {} as never });
|
||||
|
||||
expect(
|
||||
plugin.commands?.resolveNativeCommandName?.({
|
||||
commandKey: "tts",
|
||||
defaultName: "tts",
|
||||
}),
|
||||
).toBe("voice");
|
||||
expect(
|
||||
plugin.commands?.resolveNativeCommandName?.({
|
||||
commandKey: "status",
|
||||
defaultName: "status",
|
||||
}),
|
||||
).toBe("status");
|
||||
});
|
||||
});
|
||||
@@ -1,5 +1,27 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { setSlackChannelAllowlist } from "./shared.js";
|
||||
import { createSlackPluginBase, setSlackChannelAllowlist } from "./shared.js";
|
||||
|
||||
describe("createSlackPluginBase", () => {
|
||||
it("owns Slack native command name overrides", () => {
|
||||
const plugin = createSlackPluginBase({
|
||||
setup: {} as never,
|
||||
setupWizard: {} as never,
|
||||
});
|
||||
|
||||
expect(
|
||||
plugin.commands?.resolveNativeCommandName?.({
|
||||
commandKey: "status",
|
||||
defaultName: "status",
|
||||
}),
|
||||
).toBe("agentstatus");
|
||||
expect(
|
||||
plugin.commands?.resolveNativeCommandName?.({
|
||||
commandKey: "tts",
|
||||
defaultName: "tts",
|
||||
}),
|
||||
).toBe("tts");
|
||||
});
|
||||
});
|
||||
|
||||
describe("setSlackChannelAllowlist", () => {
|
||||
it("writes canonical enabled entries for setup-generated channel allowlists", () => {
|
||||
|
||||
Reference in New Issue
Block a user