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

推荐订阅源

G
Google Developers Blog
博客园 - 聂微东
J
Java Code Geeks
Engineering at Meta
Engineering at Meta
Jina AI
Jina AI
D
Docker
B
Blog
S
SegmentFault 最新的问题
宝玉的分享
宝玉的分享
D
DataBreaches.Net
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Y
Y Combinator Blog
N
Netflix TechBlog - Medium
月光博客
月光博客
F
Fortinet All Blogs
爱范儿
爱范儿
H
Help Net Security
腾讯CDC
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
WordPress大学
WordPress大学
The Cloudflare Blog
有赞技术团队
有赞技术团队
T
Tailwind CSS Blog
U
Unit 42

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: guard slack outbound mock calls · openclaw/openclaw...
steipete · 2026-05-12 · via Recent Commits to openclaw:main

@@ -10,7 +10,19 @@ function createHarness(params: {

1010

return createSlackOutboundPayloadHarness(params);

1111

}

121213-

function sendOptions(call: unknown[] | undefined): {

13+

type MockWithCalls = {

14+

mock: { calls: unknown[][] };

15+

};

16+17+

function sendCall(sendMock: MockWithCalls, index: number): unknown[] {

18+

const call = sendMock.mock.calls[index];

19+

if (!call) {

20+

throw new Error(`expected Slack send call ${index}`);

21+

}

22+

return call;

23+

}

24+25+

function sendOptions(call: unknown[]): {

1426

blocks?: Array<{

1527

block_id?: string;

1628

elements?: Array<{ action_id?: string }>;

@@ -44,9 +56,9 @@ describe("slackOutbound sendPayload", () => {

4456

const result = await run();

45574658

expect(sendMock).toHaveBeenCalledTimes(1);

47-

const call = sendMock.mock.calls[0];

48-

expect(call?.[0]).toBe(to);

49-

expect(call?.[1]).toBe("Fallback summary");

59+

const call = sendCall(sendMock, 0);

60+

expect(call[0]).toBe(to);

61+

expect(call[1]).toBe("Fallback summary");

5062

expect(sendOptions(call).blocks).toEqual([{ type: "divider" }]);

5163

expect(result.channel).toBe("slack");

5264

expect(result.messageId).toBe("sl-1");

@@ -72,14 +84,14 @@ describe("slackOutbound sendPayload", () => {

7284

const result = await run();

73857486

expect(sendMock).toHaveBeenCalledTimes(2);

75-

const mediaCall = sendMock.mock.calls[0];

76-

expect(mediaCall?.[0]).toBe(to);

77-

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

87+

const mediaCall = sendCall(sendMock, 0);

88+

expect(mediaCall[0]).toBe(to);

89+

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

7890

expect(sendOptions(mediaCall).mediaUrl).toBe("https://example.com/image.png");

79-

expect(mediaCall?.[2]).not.toHaveProperty("blocks");

80-

const controlsCall = sendMock.mock.calls[1];

81-

expect(controlsCall?.[0]).toBe(to);

82-

expect(controlsCall?.[1]).toBe("Approval required");

91+

expect(mediaCall[2]).not.toHaveProperty("blocks");

92+

const controlsCall = sendCall(sendMock, 1);

93+

expect(controlsCall[0]).toBe(to);

94+

expect(controlsCall[1]).toBe("Approval required");

8395

expect(sendOptions(controlsCall).blocks?.[0]?.type).toBe("actions");

8496

expect(result.channel).toBe("slack");

8597

expect(result.messageId).toBe("sl-controls");

@@ -141,9 +153,9 @@ describe("slackOutbound sendPayload", () => {

141153

await run();

142154143155

expect(sendMock).toHaveBeenCalledTimes(1);

144-

const call = sendMock.mock.calls[0];

145-

expect(call?.[0]).toBe(to);

146-

expect(call?.[1]).toBe("Deploy?");

156+

const call = sendCall(sendMock, 0);

157+

expect(call[0]).toBe(to);

158+

expect(call[1]).toBe("Deploy?");

147159

const blocks = sendOptions(call).blocks;

148160

expect(blocks?.[0]?.block_id).toBe("openclaw_reply_buttons_1");

149161

expect(blocks?.[1]?.block_id).toBe("openclaw_reply_buttons_2");