惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Hacker News: Ask HN
Hacker News: Ask HN
WordPress大学
WordPress大学
GbyAI
GbyAI
T
Tailwind CSS Blog
Know Your Adversary
Know Your Adversary
小众软件
小众软件
Security Latest
Security Latest
博客园 - 聂微东
P
Privacy International News Feed
L
Lohrmann on Cybersecurity
爱范儿
爱范儿
云风的 BLOG
云风的 BLOG
阮一峰的网络日志
阮一峰的网络日志
C
Cyber Attacks, Cyber Crime and Cyber Security
博客园 - 叶小钗
Last Week in AI
Last Week in AI
The Register - Security
The Register - Security
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
Vulnerabilities – Threatpost
Jina AI
Jina AI
AWS News Blog
AWS News Blog
L
LINUX DO - 热门话题
D
Darknet – Hacking Tools, Hacker News & Cyber Security
NISL@THU
NISL@THU
Spread Privacy
Spread Privacy
Google DeepMind News
Google DeepMind News
P
Palo Alto Networks Blog
S
Schneier on Security
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
The Exploit Database - CXSecurity.com
月光博客
月光博客
C
CERT Recently Published Vulnerability Notes
G
GRAHAM CLULEY
N
Netflix TechBlog - Medium
量子位
K
Kaspersky official blog
T
Threatpost
Latest news
Latest news
The Cloudflare Blog
MyScale Blog
MyScale Blog
C
Cisco Blogs
T
Tor Project blog
S
Securelist
Cisco Talos Blog
Cisco Talos Blog
The GitHub Blog
The GitHub Blog
A
Arctic Wolf
T
Threat Research - Cisco Blogs
H
Help Net Security
C
CXSECURITY Database RSS Feed - CXSecurity.com

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4 test: trim doctor command hotspots · openclaw/openclaw@c66f16a test: isolate agent auth and spawn hotspots · openclaw/openclaw@9285935 test: stabilize MCP startup disposal race · openclaw/openclaw@dd9d2eb test: merge browser contract server suites · openclaw/openclaw@5817a76 test: narrow ollama provider discovery setup · openclaw/openclaw@a0d9598 build: declare qa-lab aimock runtime dependency · openclaw/openclaw@24431e5 test: speed up safe-bins exec harness · openclaw/openclaw@ee856ab test: preserve tool helpers in embedded runner mocks · openclaw/openclaw@acd86a0 refactor: move memory embeddings into provider plugins · openclaw/openclaw@77e6e4c test: reuse system-run temp fixtures · openclaw/openclaw@7e9ff0f test: trim hotspot wait overhead · openclaw/openclaw@12a59b0 Check: avoid duplicate boundary prep · openclaw/openclaw@baf11b8 test: reduce hotspot fixture overhead · openclaw/openclaw@3a59edd feat(ui): overhaul settings and slash command UX (#67819) thanks @Bun… · openclaw/openclaw@2cfb660 QA Matrix: exit cleanly on failure · openclaw/openclaw@42805d2 QA Matrix: isolate scenario coverage · openclaw/openclaw@7e659e1 Matrix: refresh crypto bootstrap state · openclaw/openclaw@94081d8 QA Lab: add provider registry · openclaw/openclaw@bb7e982 Matrix: add plugin changelog · openclaw/openclaw@4acab55 test: trim more hotspot overhead · openclaw/openclaw@f485311 test: trim remaining hotspot tests · openclaw/openclaw@6ba8626 test: narrow hotspot mocks · openclaw/openclaw@dbc8179 test: isolate gemini embedding request helpers · openclaw/openclaw@cd330f5 test: trim memory and mcp hotspots · openclaw/openclaw@fd48dfa test: slim provider registry mocks · openclaw/openclaw@2e08c77 test: harden Parallels update smoke · openclaw/openclaw@1a98090 feat: default Anthropic to Opus 4.7 · openclaw/openclaw@628b454 fix: harden node-host shell payload mutability checks · openclaw/openclaw@75c551e fix: land node-host approval binding for native binaries (#66731) (th… · openclaw/openclaw@29919bb CI: add daily schedule to CodeQL workflow (#67645) · openclaw/openclaw@69d25f5 fix(gateway): capture config hash after plugin auto-enable to prevent… · openclaw/openclaw@8c11210 fix: repair sanitized replay tool results before send (#67620) (thank… · openclaw/openclaw@c3c7a99 fix: restrict HTML timeout short-circuit to transient statuses · openclaw/openclaw@de129a6 fix: keep TUI watchdog bound to active run (#67401) (thanks @xantorres) · openclaw/openclaw@3525273 Gateway/skills: dedupe skills prefix-match + drop dead fallback on log · openclaw/openclaw@d7f489f Extensions/lmstudio: back off inference preload after consecutive fai… · openclaw/openclaw@b555214 TUI/streaming: add watchdog that resets the activity indicator after … · openclaw/openclaw@f44ab20 Agents/tool-loop: enable unknown-tool stream guard by default · openclaw/openclaw@36ed367 Gateway/skills: invalidate session skills snapshot on config write · openclaw/openclaw@b23d59a fix: classify HTML provider error pages correctly (#67642) (thanks @s… · openclaw/openclaw@e588e90 fix(skills): remove unused model-usage import (#67641) · openclaw/openclaw@55f05df docs(changelog): credit codex fix superseded PRs · openclaw/openclaw@e485f24 fix(openai-codex): normalize stale transport metadata in resolution a… · openclaw/openclaw@90801ba CI: pin Docker-related GitHub Actions (#67632) · openclaw/openclaw@f697b01 Android: modernize WebView and discovery API usage (#67627) · openclaw/openclaw@44a6e50 fix(deps): bump hono to 4.12.14 and @hono/node-server to 1.19.14 (GHS… · openclaw/openclaw@fbccc18 fix(deps): bump dompurify to 3.4.0 (#67614) · openclaw/openclaw@2c2dc00 CI: add explicit permissions to all workflow jobs (fixes code-scannin… · openclaw/openclaw@01b7516 fix: register bundled TTS providers and route overrides correctly (#6… · openclaw/openclaw@6ea3cdd fix: align host tilde paths with OS home (#62804) (thanks @stainlu) · openclaw/openclaw@ecfaf64 fix: flush creds queue before reconnect socket open (#67464) (thanks … · openclaw/openclaw@405c63f fix: strip standalone <function> tool call tags from visible text (#6… · openclaw/openclaw@78df859 fix(agents): preserve cli session metadata before transcript persist … · openclaw/openclaw@898fd04 docs(changelog): move cli transcript entry · openclaw/openclaw@c1817c6 fix(agents): normalize cli transcript api field · openclaw/openclaw@3a3fae0 docs(changelog): note cli transcript persistence · openclaw/openclaw@6c343f1 fix(agents): persist cli transcript turns · openclaw/openclaw@b8ef507 fix(msteams): harden security-sensitive flows (#65841) · openclaw/openclaw@c56b56e [Dashboard] Fix exec approval modal overflow for long command content… · openclaw/openclaw@053c5b0 Docs: remove QA changelog entry · openclaw/openclaw@7fd5771 QA: fix private runtime source loading (#67428) · openclaw/openclaw@d5933af docs(gateway): correct protocol.md schema path, hello-ok example, aut… · openclaw/openclaw@489404d CI: pin Node 22 runners to 22.18.0 · openclaw/openclaw@4ffa621 models.authStatus: normalize provider ids + tighten env-backed escape… · openclaw/openclaw@f2fdb9d Update CHANGELOG.md · openclaw/openclaw@7694a92 test(parallels): clean up npm update guard jobs · openclaw/openclaw@045ea7b Plugins: prefer scanDir override paths · openclaw/openclaw@b2974da fix(dreaming): default storage.mode to "separate" so phase blocks sto… · openclaw/openclaw@8c392f0 fix(memory-core): skip dreaming transcript ingestion via session stor… · openclaw/openclaw@a1b01f0 fix: dedupe replayed exec.finished node events (#67281) · openclaw/openclaw@5dcf526
test: tighten discord outbound adapter assertions · openclaw/openclaw@31fa105
steipete · 2026-05-11 · via Recent Commits to openclaw:main

@@ -13,6 +13,29 @@ await installDiscordOutboundModuleSpies(hoisted);

1313

let normalizeDiscordOutboundTarget: typeof import("./normalize.js").normalizeDiscordOutboundTarget;

1414

let discordOutbound: typeof import("./outbound-adapter.js").discordOutbound;

151516+

type MockCallSource = { mock: { calls: Array<Array<unknown>> } };

17+18+

function mockCall(source: MockCallSource, label: string, callIndex = 0): Array<unknown> {

19+

const call = source.mock.calls[callIndex];

20+

if (!call) {

21+

throw new Error(`expected ${label} call ${callIndex}`);

22+

}

23+

return call;

24+

}

25+26+

function mockObjectArg(

27+

source: MockCallSource,

28+

label: string,

29+

callIndex: number,

30+

argIndex: number,

31+

): Record<string, unknown> {

32+

const value = mockCall(source, label, callIndex)[argIndex];

33+

if (!value || typeof value !== "object") {

34+

throw new Error(`expected ${label} call ${callIndex} argument ${argIndex} to be an object`);

35+

}

36+

return value as Record<string, unknown>;

37+

}

38+1639

beforeAll(async () => {

1740

({ normalizeDiscordOutboundTarget } = await import("./normalize.js"));

1841

({ discordOutbound } = await import("./outbound-adapter.js"));

@@ -125,16 +148,14 @@ describe("discordOutbound", () => {

125148

},

126149

});

127150128-

expect(hoisted.sendMessageDiscordMock).toHaveBeenCalledWith(

129-

"channel:123456",

130-

"formatted",

131-

expect.objectContaining({

132-

textLimit: 1234,

133-

maxLinesPerMessage: 7,

134-

tableMode: "off",

135-

chunkMode: "newline",

136-

}),

137-

);

151+

const call = mockCall(hoisted.sendMessageDiscordMock, "sendMessageDiscord");

152+

expect(call[0]).toBe("channel:123456");

153+

expect(call[1]).toBe("formatted");

154+

const options = mockObjectArg(hoisted.sendMessageDiscordMock, "sendMessageDiscord", 0, 2);

155+

expect(options.textLimit).toBe(1234);

156+

expect(options.maxLinesPerMessage).toBe(7);

157+

expect(options.tableMode).toBe("off");

158+

expect(options.chunkMode).toBe("newline");

138159

});

139160140161

it.each([500, 429])("retries transient Discord text send status %i", async (status) => {

@@ -190,22 +211,22 @@ describe("discordOutbound", () => {

190211

},

191212

});

192213193-

expect(hoisted.sendWebhookMessageDiscordMock).toHaveBeenCalledWith(

194-

"hello from persona",

195-

expect.objectContaining({

196-

webhookId: "wh-1",

197-

webhookToken: "tok-1",

198-

accountId: "default",

199-

threadId: "thread-1",

200-

replyTo: "reply-1",

201-

username: "Codex",

202-

avatarUrl: "https://example.com/avatar.png",

203-

}),

214+

const call = mockCall(hoisted.sendWebhookMessageDiscordMock, "sendWebhookMessageDiscord");

215+

expect(call[0]).toBe("hello from persona");

216+

const options = mockObjectArg(

217+

hoisted.sendWebhookMessageDiscordMock,

218+

"sendWebhookMessageDiscord",

219+

0,

220+

1,

204221

);

205-

expect(

206-

(hoisted.sendWebhookMessageDiscordMock.mock.calls[0]?.[1] as { cfg?: unknown } | undefined)

207-

?.cfg,

208-

).toBe(cfg);

222+

expect(options.webhookId).toBe("wh-1");

223+

expect(options.webhookToken).toBe("tok-1");

224+

expect(options.accountId).toBe("default");

225+

expect(options.threadId).toBe("thread-1");

226+

expect(options.replyTo).toBe("reply-1");

227+

expect(options.username).toBe("Codex");

228+

expect(options.avatarUrl).toBe("https://example.com/avatar.png");

229+

expect(options.cfg).toBe(cfg);

209230

expect(hoisted.sendMessageDiscordMock).not.toHaveBeenCalled();

210231

expect(result).toEqual({

211232

channel: "discord",

@@ -267,15 +288,14 @@ describe("discordOutbound", () => {

267288

threadId: "thread-1",

268289

});

269290270-

expect(hoisted.sendPollDiscordMock).toHaveBeenCalledWith(

271-

"channel:thread-1",

272-

{

273-

question: "Best snack?",

274-

options: ["banana", "apple"],

275-

},

276-

expect.objectContaining({

277-

accountId: "default",

278-

}),

291+

const call = mockCall(hoisted.sendPollDiscordMock, "sendPollDiscord");

292+

expect(call[0]).toBe("channel:thread-1");

293+

expect(call[1]).toEqual({

294+

question: "Best snack?",

295+

options: ["banana", "apple"],

296+

});

297+

expect(mockObjectArg(hoisted.sendPollDiscordMock, "sendPollDiscord", 0, 2).accountId).toBe(

298+

"default",

279299

);

280300

expect(result).toEqual({

281301

channel: "discord",

@@ -299,31 +319,37 @@ describe("discordOutbound", () => {

299319

replyToMode: "first",

300320

});

301321302-

expect(hoisted.sendVoiceMessageDiscordMock).toHaveBeenCalledWith(

303-

"channel:123456",

304-

"https://example.com/voice.ogg",

305-

expect.objectContaining({

306-

accountId: "default",

307-

replyTo: "reply-1",

308-

}),

322+

const voiceCall = mockCall(hoisted.sendVoiceMessageDiscordMock, "sendVoiceMessageDiscord");

323+

expect(voiceCall[0]).toBe("channel:123456");

324+

expect(voiceCall[1]).toBe("https://example.com/voice.ogg");

325+

const voiceOptions = mockObjectArg(

326+

hoisted.sendVoiceMessageDiscordMock,

327+

"sendVoiceMessageDiscord",

328+

0,

329+

2,

309330

);

310-

expect(hoisted.sendMessageDiscordMock).toHaveBeenCalledWith(

311-

"channel:123456",

312-

"voice note",

313-

expect.objectContaining({

314-

accountId: "default",

315-

replyTo: undefined,

316-

}),

317-

);

318-

expect(hoisted.sendMessageDiscordMock).toHaveBeenCalledWith(

319-

"channel:123456",

320-

"",

321-

expect.objectContaining({

322-

accountId: "default",

323-

mediaUrl: "https://example.com/extra.png",

324-

replyTo: undefined,

325-

}),

331+

expect(voiceOptions.accountId).toBe("default");

332+

expect(voiceOptions.replyTo).toBe("reply-1");

333+334+

const messageCall = mockCall(hoisted.sendMessageDiscordMock, "sendMessageDiscord", 0);

335+

expect(messageCall[0]).toBe("channel:123456");

336+

expect(messageCall[1]).toBe("voice note");

337+

const messageOptions = mockObjectArg(

338+

hoisted.sendMessageDiscordMock,

339+

"sendMessageDiscord",

340+

0,

341+

2,

326342

);

343+

expect(messageOptions.accountId).toBe("default");

344+

expect(messageOptions.replyTo).toBeUndefined();

345+346+

const mediaCall = mockCall(hoisted.sendMessageDiscordMock, "sendMessageDiscord", 1);

347+

expect(mediaCall[0]).toBe("channel:123456");

348+

expect(mediaCall[1]).toBe("");

349+

const mediaOptions = mockObjectArg(hoisted.sendMessageDiscordMock, "sendMessageDiscord", 1, 2);

350+

expect(mediaOptions.accountId).toBe("default");

351+

expect(mediaOptions.mediaUrl).toBe("https://example.com/extra.png");

352+

expect(mediaOptions.replyTo).toBeUndefined();

327353

expect(result).toEqual({

328354

channel: "discord",

329355

messageId: "msg-1",

@@ -393,22 +419,24 @@ describe("discordOutbound", () => {

393419

replyToId: "reply-1",

394420

});

395421396-

expect(hoisted.sendMessageDiscordMock).toHaveBeenCalledWith(

397-

"channel:123456",

398-

"rendered clip",

399-

expect.objectContaining({

400-

accountId: "default",

401-

replyTo: "reply-1",

402-

}),

403-

);

404-

expect(hoisted.sendMessageDiscordMock).toHaveBeenCalledWith(

405-

"channel:123456",

406-

"",

407-

expect.objectContaining({

408-

accountId: "default",

409-

mediaUrl: "/tmp/render.mp4",

410-

}),

422+

const captionCall = mockCall(hoisted.sendMessageDiscordMock, "sendMessageDiscord", 0);

423+

expect(captionCall[0]).toBe("channel:123456");

424+

expect(captionCall[1]).toBe("rendered clip");

425+

const captionOptions = mockObjectArg(

426+

hoisted.sendMessageDiscordMock,

427+

"sendMessageDiscord",

428+

0,

429+

2,

411430

);

431+

expect(captionOptions.accountId).toBe("default");

432+

expect(captionOptions.replyTo).toBe("reply-1");

433+434+

const mediaCall = mockCall(hoisted.sendMessageDiscordMock, "sendMessageDiscord", 1);

435+

expect(mediaCall[0]).toBe("channel:123456");

436+

expect(mediaCall[1]).toBe("");

437+

const mediaOptions = mockObjectArg(hoisted.sendMessageDiscordMock, "sendMessageDiscord", 1, 2);

438+

expect(mediaOptions.accountId).toBe("default");

439+

expect(mediaOptions.mediaUrl).toBe("/tmp/render.mp4");

412440

});

413441414442

it("touches bound thread activity after shared outbound delivery succeeds", async () => {

@@ -472,26 +500,39 @@ describe("discordOutbound", () => {

472500

replyToMode: "first",

473501

});

474502475-

expect(hoisted.sendDiscordComponentMessageMock).toHaveBeenCalledWith(

476-

"channel:123456",

477-

expect.objectContaining({ text: "hello" }),

478-

expect.objectContaining({

479-

mediaUrl: "https://example.com/1.png",

480-

mediaLocalRoots: ["/tmp/media"],

481-

accountId: "default",

482-

replyTo: "reply-1",

483-

}),

503+

const componentCall = mockCall(

504+

hoisted.sendDiscordComponentMessageMock,

505+

"sendDiscordComponentMessage",

484506

);

485-

expect(hoisted.sendMessageDiscordMock).toHaveBeenCalledWith(

486-

"channel:123456",

487-

"",

488-

expect.objectContaining({

489-

mediaUrl: "https://example.com/2.png",

490-

mediaLocalRoots: ["/tmp/media"],

491-

accountId: "default",

492-

replyTo: undefined,

493-

}),

507+

expect(componentCall[0]).toBe("channel:123456");

508+

expect(

509+

mockObjectArg(hoisted.sendDiscordComponentMessageMock, "sendDiscordComponentMessage", 0, 1)

510+

.text,

511+

).toBe("hello");

512+

const componentOptions = mockObjectArg(

513+

hoisted.sendDiscordComponentMessageMock,

514+

"sendDiscordComponentMessage",

515+

0,

516+

2,

494517

);

518+

expect(componentOptions.mediaUrl).toBe("https://example.com/1.png");

519+

expect(componentOptions.mediaLocalRoots).toEqual(["/tmp/media"]);

520+

expect(componentOptions.accountId).toBe("default");

521+

expect(componentOptions.replyTo).toBe("reply-1");

522+523+

const messageCall = mockCall(hoisted.sendMessageDiscordMock, "sendMessageDiscord");

524+

expect(messageCall[0]).toBe("channel:123456");

525+

expect(messageCall[1]).toBe("");

526+

const messageOptions = mockObjectArg(

527+

hoisted.sendMessageDiscordMock,

528+

"sendMessageDiscord",

529+

0,

530+

2,

531+

);

532+

expect(messageOptions.mediaUrl).toBe("https://example.com/2.png");

533+

expect(messageOptions.mediaLocalRoots).toEqual(["/tmp/media"]);

534+

expect(messageOptions.accountId).toBe("default");

535+

expect(messageOptions.replyTo).toBeUndefined();

495536

expect(result).toEqual({

496537

channel: "discord",

497538

messageId: "msg-2",

@@ -560,17 +601,15 @@ describe("discordOutbound", () => {

560601

replyToId: "reply-1",

561602

});

562603563-

expect(hoisted.sendMessageDiscordMock).toHaveBeenCalledWith(

564-

"channel:123456",

565-

"hello",

566-

expect.objectContaining({

567-

mediaUrl: "https://example.com/photo.png",

568-

components: [{ type: 1, components: [] }],

569-

filename: "photo.png",

570-

accountId: "default",

571-

replyTo: "reply-1",

572-

}),

573-

);

604+

const call = mockCall(hoisted.sendMessageDiscordMock, "sendMessageDiscord");

605+

expect(call[0]).toBe("channel:123456");

606+

expect(call[1]).toBe("hello");

607+

const options = mockObjectArg(hoisted.sendMessageDiscordMock, "sendMessageDiscord", 0, 2);

608+

expect(options.mediaUrl).toBe("https://example.com/photo.png");

609+

expect(options.components).toEqual([{ type: 1, components: [] }]);

610+

expect(options.filename).toBe("photo.png");

611+

expect(options.accountId).toBe("default");

612+

expect(options.replyTo).toBe("reply-1");

574613

});

575614576615

it("preserves explicit component payload replies when replyToMode is off", async () => {

@@ -641,14 +680,20 @@ describe("discordOutbound", () => {

641680

accountId: "default",

642681

});

643682644-

expect(hoisted.sendDiscordComponentMessageMock).toHaveBeenCalledWith(

645-

"channel:123456",

646-

expect.objectContaining({

647-

text: "native component text",

648-

blocks: [{ type: "text", text: "Native component body" }],

649-

}),

650-

expect.objectContaining({ accountId: "default" }),

683+

const call = mockCall(hoisted.sendDiscordComponentMessageMock, "sendDiscordComponentMessage");

684+

expect(call[0]).toBe("channel:123456");

685+

const payload = mockObjectArg(

686+

hoisted.sendDiscordComponentMessageMock,

687+

"sendDiscordComponentMessage",

688+

0,

689+

1,

651690

);

691+

expect(payload.text).toBe("native component text");

692+

expect(payload.blocks).toEqual([{ type: "text", text: "Native component body" }]);

693+

expect(

694+

mockObjectArg(hoisted.sendDiscordComponentMessageMock, "sendDiscordComponentMessage", 0, 2)

695+

.accountId,

696+

).toBe("default");

652697

expect(hoisted.sendMessageDiscordMock).not.toHaveBeenCalled();

653698

});

654699

@@ -669,13 +714,12 @@ describe("discordOutbound", () => {

669714

accountId: "default",

670715

});

671716672-

expect(hoisted.sendMessageDiscordMock).toHaveBeenCalledWith(

673-

"channel:123456",

674-

"Approval @\u200beveryone <@\u200b123> <#\u200b456>",

675-

expect.objectContaining({

676-

accountId: "default",

677-

}),

678-

);

717+

const call = mockCall(hoisted.sendMessageDiscordMock, "sendMessageDiscord");

718+

expect(call[0]).toBe("channel:123456");

719+

expect(call[1]).toBe("Approval @\u200beveryone <@\u200b123> <#\u200b456>");

720+

expect(

721+

mockObjectArg(hoisted.sendMessageDiscordMock, "sendMessageDiscord", 0, 2).accountId,

722+

).toBe("default");

679723

});

680724681725

it("uses a single implicit reply for chunked approval payload fallbacks", async () => {

@@ -717,12 +761,11 @@ describe("discordOutbound", () => {

717761

accountId: "default",

718762

});

719763720-

expect(hoisted.sendMessageDiscordMock).toHaveBeenCalledWith(

721-

"channel:123456",

722-

"Hello @everyone",

723-

expect.objectContaining({

724-

accountId: "default",

725-

}),

726-

);

764+

const call = mockCall(hoisted.sendMessageDiscordMock, "sendMessageDiscord");

765+

expect(call[0]).toBe("channel:123456");

766+

expect(call[1]).toBe("Hello @everyone");

767+

expect(

768+

mockObjectArg(hoisted.sendMessageDiscordMock, "sendMessageDiscord", 0, 2).accountId,

769+

).toBe("default");

727770

});

728771

});