test: tighten discord interaction wait assertion · openclaw/openclaw@f8b4469
shakkernerd
·
2026-05-11
·
via Recent Commits to openclaw:main
File tree
extensions/discord/src/internal
| Original file line number | Diff line number | Diff line change |
|---|
@@ -13,6 +13,7 @@ import {
|
13 | 13 | createInteraction, |
14 | 14 | type RawInteraction, |
15 | 15 | } from "./interactions.js"; |
| 16 | +import { Message } from "./structures.js"; |
16 | 17 | import { |
17 | 18 | attachRestMock, |
18 | 19 | createInternalComponentInteractionPayload, |
@@ -237,12 +238,13 @@ describe("BaseInteraction", () => {
|
237 | 238 | }), |
238 | 239 | ); |
239 | 240 | |
240 | | -await expect(wait).resolves.toEqual({ |
241 | | -success: true, |
242 | | -customId: "button1", |
243 | | -message: expect.objectContaining({ id: "message1", channelId: "channel1" }), |
244 | | -values: undefined, |
245 | | -}); |
| 241 | +const result = await wait; |
| 242 | +expect(result.success).toBe(true); |
| 243 | +expect(result.customId).toBe("button1"); |
| 244 | +expect(result.message).toBeInstanceOf(Message); |
| 245 | +expect(result.message?.id).toBe("message1"); |
| 246 | +expect(result.message?.channelId).toBe("channel1"); |
| 247 | +expect(result.values).toBeUndefined(); |
246 | 248 | expect(post).toHaveBeenNthCalledWith( |
247 | 249 | 2, |
248 | 250 | "/interactions/component-interaction1/component-token1/callback", |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。