mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 17:51:22 +00:00
test: mock message action aliases in normalization
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user