test: tighten feishu launcher send assertion · openclaw/openclaw@1b3f6f0
shakkernerd
·
2026-05-11
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -76,12 +76,14 @@ describe("feishu quick-action launcher", () => {
|
76 | 76 | }); |
77 | 77 | |
78 | 78 | expect(handled).toBe(true); |
79 | | -expect(sendCardFeishuMock).toHaveBeenCalledWith( |
80 | | -expect.objectContaining({ |
81 | | -to: "user:u123", |
82 | | -accountId: "main", |
83 | | -}), |
84 | | -); |
| 79 | +expect(sendCardFeishuMock).toHaveBeenCalledTimes(1); |
| 80 | +const sendArgs = sendCardFeishuMock.mock.calls[0]?.[0] as |
| 81 | +| { accountId?: string; card?: unknown; cfg?: ClawdbotConfig; to?: string } |
| 82 | +| undefined; |
| 83 | +expect(Object.keys(sendArgs ?? {}).sort()).toEqual(["accountId", "card", "cfg", "to"]); |
| 84 | +expect(sendArgs?.cfg).toBe(cfg); |
| 85 | +expect(sendArgs?.to).toBe("user:u123"); |
| 86 | +expect(sendArgs?.accountId).toBe("main"); |
85 | 87 | expectSentCardHasP2pAction(sendCardFeishuMock); |
86 | 88 | expectFirstSentCardUsesFillWidthOnly(sendCardFeishuMock); |
87 | 89 | }); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。