test: tighten discord command arg assertion · openclaw/openclaw@b496539
shakkernerd
·
2026-05-11
·
via Recent Commits to openclaw:main
File tree
extensions/discord/src/monitor
| Original file line number | Diff line number | Diff line change |
|---|
@@ -89,11 +89,12 @@ describe("discord command argument fallback", () => {
|
89 | 89 | user: "owner", |
90 | 90 | } satisfies CommandArgData); |
91 | 91 | |
92 | | -expect(dispatchSpy).toHaveBeenCalledWith( |
93 | | -expect.objectContaining({ |
94 | | -prompt: "/think high", |
95 | | -responseEphemeral: false, |
96 | | -}), |
97 | | -); |
| 92 | +expect(dispatchSpy).toHaveBeenCalledTimes(1); |
| 93 | +const dispatchCall = dispatchSpy.mock.calls[0]?.[0]; |
| 94 | +expect(dispatchCall?.prompt).toBe("/think high"); |
| 95 | +expect(dispatchCall?.responseEphemeral).toBe(false); |
| 96 | +expect(dispatchCall?.accountId).toBe("default"); |
| 97 | +expect(dispatchCall?.sessionPrefix).toBe("discord:slash"); |
| 98 | +expect(dispatchCall?.preferFollowUp).toBe(true); |
98 | 99 | }); |
99 | 100 | }); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。