test: mock message action aliases in normalization

This commit is contained in:
Peter Steinberger
2026-04-11 06:45:53 +01:00
parent 28291eba62
commit 3edc8d3028

View File

@@ -1,6 +1,23 @@
import { describe, expect, it } from "vitest";
import { describe, expect, it, vi } from "vitest";
import { normalizeMessageActionInput } from "./message-action-normalization.js";
vi.mock("../../channels/plugins/bootstrap-registry.js", () => ({
getBootstrapChannelPlugin: (channel: string) =>
channel === "feishu"
? {
actions: {
messageActionTargetAliases: {
read: { aliases: ["messageId"] },
pin: { aliases: ["messageId"] },
unpin: { aliases: ["messageId"] },
"list-pins": { aliases: ["chatId"] },
"channel-info": { aliases: ["chatId"] },
},
},
}
: undefined,
}));
describe("normalizeMessageActionInput", () => {
type NormalizeMessageActionInputCase = {
input: Parameters<typeof normalizeMessageActionInput>[0];