mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 06:42:44 +00:00
test: remove duplicate sticker recipient normalization checks
This commit is contained in:
@@ -1131,43 +1131,6 @@ describe("sendStickerTelegram", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("normalizes chat ids with internal prefixes", async () => {
|
|
||||||
const sendSticker = vi.fn().mockResolvedValue({
|
|
||||||
message_id: 104,
|
|
||||||
chat: { id: "123" },
|
|
||||||
});
|
|
||||||
const api = { sendSticker } as unknown as {
|
|
||||||
sendSticker: typeof sendSticker;
|
|
||||||
};
|
|
||||||
|
|
||||||
await sendStickerTelegram("telegram:123", "fileId123", {
|
|
||||||
token: "tok",
|
|
||||||
api,
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(sendSticker).toHaveBeenCalledWith("123", "fileId123", undefined);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("parses message_thread_id from recipient string (telegram:group:...:topic:...)", async () => {
|
|
||||||
const chatId = "-1001234567890";
|
|
||||||
const sendSticker = vi.fn().mockResolvedValue({
|
|
||||||
message_id: 105,
|
|
||||||
chat: { id: chatId },
|
|
||||||
});
|
|
||||||
const api = { sendSticker } as unknown as {
|
|
||||||
sendSticker: typeof sendSticker;
|
|
||||||
};
|
|
||||||
|
|
||||||
await sendStickerTelegram(`telegram:group:${chatId}:topic:271`, "fileId123", {
|
|
||||||
token: "tok",
|
|
||||||
api,
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(sendSticker).toHaveBeenCalledWith(chatId, "fileId123", {
|
|
||||||
message_thread_id: 271,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it("wraps chat-not-found with actionable context", async () => {
|
it("wraps chat-not-found with actionable context", async () => {
|
||||||
const chatId = "123";
|
const chatId = "123";
|
||||||
const err = new Error("400: Bad Request: chat not found");
|
const err = new Error("400: Bad Request: chat not found");
|
||||||
|
|||||||
Reference in New Issue
Block a user