test(telegram): cover shared parsing without registry
This commit is contained in:
parent
55f6d2d1ad
commit
e78b51baea
@ -1,4 +1,6 @@
|
|||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
|
import { setActivePluginRegistry } from "../../plugins/runtime.js";
|
||||||
|
import { createTestRegistry } from "../../test-utils/channel-plugins.js";
|
||||||
import {
|
import {
|
||||||
filterMessagingToolMediaDuplicates,
|
filterMessagingToolMediaDuplicates,
|
||||||
shouldSuppressMessagingToolReplies,
|
shouldSuppressMessagingToolReplies,
|
||||||
@ -153,4 +155,18 @@ describe("shouldSuppressMessagingToolReplies", () => {
|
|||||||
}),
|
}),
|
||||||
).toBe(true);
|
).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("suppresses telegram replies even when the active plugin registry omits telegram", () => {
|
||||||
|
setActivePluginRegistry(createTestRegistry([]));
|
||||||
|
|
||||||
|
expect(
|
||||||
|
shouldSuppressMessagingToolReplies({
|
||||||
|
messageProvider: "telegram",
|
||||||
|
originatingTo: "telegram:group:-100123:topic:77",
|
||||||
|
messagingToolSentTargets: [
|
||||||
|
{ tool: "message", provider: "telegram", to: "-100123", threadId: "77" },
|
||||||
|
],
|
||||||
|
}),
|
||||||
|
).toBe(true);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -136,6 +136,22 @@ describe("registerPluginCommand", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("resolves Telegram topic command bindings without a Telegram registry entry", () => {
|
||||||
|
expect(
|
||||||
|
__testing.resolveBindingConversationFromCommand({
|
||||||
|
channel: "telegram",
|
||||||
|
from: "telegram:group:-100123",
|
||||||
|
to: "telegram:group:-100123:topic:77",
|
||||||
|
accountId: "default",
|
||||||
|
}),
|
||||||
|
).toEqual({
|
||||||
|
channel: "telegram",
|
||||||
|
accountId: "default",
|
||||||
|
conversationId: "-100123",
|
||||||
|
threadId: 77,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it("does not resolve binding conversations for unsupported command channels", () => {
|
it("does not resolve binding conversations for unsupported command channels", () => {
|
||||||
expect(
|
expect(
|
||||||
__testing.resolveBindingConversationFromCommand({
|
__testing.resolveBindingConversationFromCommand({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user