mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-22 22:52:03 +00:00
test(agents): add missing announce delivery regressions
This commit is contained in:
@@ -1280,6 +1280,23 @@ describe("sendStickerTelegram", () => {
|
||||
expect(sendSticker).toHaveBeenNthCalledWith(2, chatId, "fileId123", undefined);
|
||||
expect(res.messageId).toBe("109");
|
||||
});
|
||||
|
||||
it("fails when sticker send returns no message_id", async () => {
|
||||
const chatId = "123";
|
||||
const sendSticker = vi.fn().mockResolvedValue({
|
||||
chat: { id: chatId },
|
||||
});
|
||||
const api = { sendSticker } as unknown as {
|
||||
sendSticker: typeof sendSticker;
|
||||
};
|
||||
|
||||
await expect(
|
||||
sendStickerTelegram(chatId, "fileId123", {
|
||||
token: "tok",
|
||||
api,
|
||||
}),
|
||||
).rejects.toThrow(/returned no message_id/i);
|
||||
});
|
||||
});
|
||||
|
||||
describe("shared send behaviors", () => {
|
||||
@@ -1542,6 +1559,20 @@ describe("sendPollTelegram", () => {
|
||||
|
||||
expect(api.sendPoll).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("fails when poll send returns no message_id", async () => {
|
||||
const api = {
|
||||
sendPoll: vi.fn(async () => ({ chat: { id: 555 }, poll: { id: "p1" } })),
|
||||
};
|
||||
|
||||
await expect(
|
||||
sendPollTelegram(
|
||||
"123",
|
||||
{ question: "Q", options: ["A", "B"] },
|
||||
{ token: "t", api: api as unknown as Bot["api"] },
|
||||
),
|
||||
).rejects.toThrow(/returned no message_id/i);
|
||||
});
|
||||
});
|
||||
|
||||
describe("createForumTopicTelegram", () => {
|
||||
|
||||
Reference in New Issue
Block a user