test(feishu): cover post mentions for other users

This commit is contained in:
Sebastian
2026-02-17 08:53:25 -05:00
parent 17c4a03e2b
commit 7884d65687

View File

@@ -103,4 +103,26 @@ describe("parseFeishuMessageEvent mentionedBot", () => {
const ctx = parseFeishuMessageEvent(event as any, "ou_bot_123");
expect(ctx.mentionedBot).toBe(false);
});
it("returns mentionedBot=false for post message with at for another user", () => {
const postContent = JSON.stringify({
content: [
[{ tag: "at", user_id: "ou_other", user_name: "other" }],
[{ tag: "text", text: "hello" }],
],
});
const event = {
sender: { sender_id: { user_id: "u1", open_id: "ou_sender" } },
message: {
message_id: "msg_1",
chat_id: "oc_chat1",
chat_type: "group",
message_type: "post",
content: postContent,
mentions: [],
},
};
const ctx = parseFeishuMessageEvent(event as any, "ou_bot_123");
expect(ctx.mentionedBot).toBe(false);
});
});