diff --git a/extensions/feishu/src/outbound.test.ts b/extensions/feishu/src/outbound.test.ts index c48c8fc76af..bed44df77a6 100644 --- a/extensions/feishu/src/outbound.test.ts +++ b/extensions/feishu/src/outbound.test.ts @@ -155,6 +155,26 @@ describe("feishuOutbound.sendText local-image auto-convert", () => { }), ); }); + + it("falls back to threadId when replyToId is empty on sendText", async () => { + await sendText({ + cfg: {} as any, + to: "chat_1", + text: "hello", + replyToId: " ", + threadId: "om_thread_2", + accountId: "main", + } as any); + + expect(sendMessageFeishuMock).toHaveBeenCalledWith( + expect.objectContaining({ + to: "chat_1", + text: "hello", + replyToMessageId: "om_thread_2", + accountId: "main", + }), + ); + }); }); describe("feishuOutbound.sendText replyToId forwarding", () => { @@ -327,5 +347,13 @@ describe("feishuOutbound.sendMedia renderMode", () => { accountId: "main", }), ); + expect(sendMessageFeishuMock).toHaveBeenCalledWith( + expect.objectContaining({ + to: "chat_1", + text: "caption", + replyToMessageId: "om_thread_1", + accountId: "main", + }), + ); }); });