Skip to content

Commit 186de9d

Browse files
committed
test: dedupe feishu outbound mock calls
1 parent cbb7313 commit 186de9d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

extensions/feishu/src/outbound.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ describe("feishuOutbound.sendPayload native cards", () => {
494494
expect(sendCardCall()?.cfg).toBe(emptyConfig);
495495
expect(sendCardCall()?.to).toBe("chat_1");
496496
expect(sendCardCall()?.accountId).toBe("main");
497-
const card = sendCardFeishuMock.mock.calls[0][0].card;
497+
const card = sendCardCall()?.card;
498498
expect(card.schema).toBe("2.0");
499499
expect(card.body.elements[0]).toEqual({ tag: "markdown", content: "Choose an action" });
500500
expect(card.body.elements[1]).toEqual({
@@ -541,7 +541,7 @@ describe("feishuOutbound.sendPayload native cards", () => {
541541
},
542542
});
543543

544-
const card = sendCardFeishuMock.mock.calls[0][0].card;
544+
const card = sendCardCall()?.card;
545545
expect(card.body.elements[0]).toEqual({
546546
tag: "markdown",
547547
content: 'Choose <at id="ou_1">',
@@ -601,7 +601,7 @@ describe("feishuOutbound.sendPayload native cards", () => {
601601
},
602602
});
603603

604-
const card = sendCardFeishuMock.mock.calls[0][0].card;
604+
const card = sendCardCall()?.card;
605605
expect(card.header.template).toBe("blue");
606606
expect(card.body.elements).toEqual([
607607
{ tag: "markdown", content: '<at id="ou_1">ping</at>' },
@@ -859,7 +859,7 @@ describe("feishuOutbound.sendText replyToId forwarding", () => {
859859
expect(sendMessageCall()?.to).toBe("chat_1");
860860
expect(sendMessageCall()?.text).toBe("hello");
861861
expect(sendMessageCall()?.accountId).toBe("main");
862-
expect(sendMessageFeishuMock.mock.calls[0][0].replyToMessageId).toBeUndefined();
862+
expect(sendMessageCall()?.replyToMessageId).toBeUndefined();
863863
});
864864

865865
it("propagates threadId as replyInThread=true to sendMessageFeishu", async () => {

0 commit comments

Comments
 (0)