test: keep command registry native overrides hermetic

This commit is contained in:
Gustavo Madeira Santana
2026-04-17 15:41:09 -04:00
parent fde25bfb8c
commit c550642cde
3 changed files with 88 additions and 1 deletions

View 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");
});
});

View File

@@ -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", () => {