mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-25 03:45:46 -06:00
test(telegram): restore DM binding regression test alongside suppression test
ClawSweeper review flagged that the new suppressReply test replaced the existing direct-message binding regression test instead of being added beside it. Restore the DM binding test to maintain coverage for the plugin command dispatch surface.
This commit is contained in:
committed by
Ayaan Zaidi
parent
6f809195b1
commit
a1553c96fd
@@ -798,6 +798,19 @@ describe("registerTelegramNativeCommands", () => {
|
||||
expect(commandParams.messageThreadId).toBe(1);
|
||||
});
|
||||
|
||||
it("forwards direct-message binding context to Telegram plugin commands", async () => {
|
||||
const { handler } = registerPlugCommand();
|
||||
|
||||
await handler(createPrivateCommandContext({ chatId: 100, userId: 200 }));
|
||||
|
||||
const commandParams = firstExecutePluginCommandParams();
|
||||
expect(commandParams.channel).toBe("telegram");
|
||||
expect(commandParams.accountId).toBe("default");
|
||||
expect(commandParams.from).toBe("telegram:100");
|
||||
expect(commandParams.to).toBe("telegram:100");
|
||||
expect(commandParams.messageThreadId).toBeUndefined();
|
||||
});
|
||||
|
||||
it("suppresses the fallback reply when a plugin command returns suppressReply: true", async () => {
|
||||
const { handler } = registerPlugCommand({
|
||||
result: { suppressReply: true },
|
||||
|
||||
Reference in New Issue
Block a user