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

推荐订阅源

J
Java Code Geeks
F
Fortinet All Blogs
Martin Fowler
Martin Fowler
M
MIT News - Artificial intelligence
G
Google Developers Blog
P
Proofpoint News Feed
Recent Announcements
Recent Announcements
MyScale Blog
MyScale Blog
D
DataBreaches.Net
Stack Overflow Blog
Stack Overflow Blog
月光博客
月光博客
爱范儿
爱范儿
罗磊的独立博客
腾讯CDC
Hugging Face - Blog
Hugging Face - Blog
博客园 - 叶小钗
Vercel News
Vercel News
酷 壳 – CoolShell
酷 壳 – CoolShell
B
Blog
C
Check Point Blog
美团技术团队
宝玉的分享
宝玉的分享
Microsoft Security Blog
Microsoft Security Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻

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: tighten mattermost send option assertions · opencla...
shakkernerd · 2026-05-11 · via Recent Commits to openclaw:main

@@ -103,6 +103,17 @@ function createMattermostActionContext(

103103

};

104104

}

105105106+

function expectSingleMattermostSend(to: string, text: string): Record<string, unknown> {

107+

expect(sendMessageMattermostMock).toHaveBeenCalledTimes(1);

108+

const [actualTo, actualText, options] = sendMessageMattermostMock.mock.calls[0] ?? [];

109+

expect(actualTo).toBe(to);

110+

expect(actualText).toBe(text);

111+

if (!options || typeof options !== "object" || Array.isArray(options)) {

112+

throw new Error("expected Mattermost send options object");

113+

}

114+

return options as Record<string, unknown>;

115+

}

116+106117

describe("mattermostPlugin", () => {

107118

beforeEach(() => {

108119

sendMessageMattermostMock.mockReset();

@@ -407,14 +418,9 @@ describe("mattermostPlugin", () => {

407418

}),

408419

);

409420410-

expect(sendMessageMattermostMock).toHaveBeenCalledWith(

411-

"channel:CHAN1",

412-

"hello",

413-

expect.objectContaining({

414-

accountId: "default",

415-

replyToId: "post-root",

416-

}),

417-

);

421+

const options = expectSingleMattermostSend("channel:CHAN1", "hello");

422+

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

423+

expect(options.replyToId).toBe("post-root");

418424

});

419425420426

it("falls back to trimmed replyTo when replyToId is blank", async () => {

@@ -434,14 +440,9 @@ describe("mattermostPlugin", () => {

434440

}),

435441

);

436442437-

expect(sendMessageMattermostMock).toHaveBeenCalledWith(

438-

"channel:CHAN1",

439-

"hello",

440-

expect.objectContaining({

441-

accountId: "default",

442-

replyToId: "post-root",

443-

}),

444-

);

443+

const options = expectSingleMattermostSend("channel:CHAN1", "hello");

444+

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

445+

expect(options.replyToId).toBe("post-root");

445446

});

446447

});

447448

@@ -468,14 +469,9 @@ describe("mattermostPlugin", () => {

468469469470

await sendMedia(params);

470471471-

expect(sendMessageMattermostMock).toHaveBeenCalledWith(

472-

"channel:CHAN1",

473-

"hello",

474-

expect.objectContaining({

475-

mediaUrl: "/tmp/workspace/image.png",

476-

mediaLocalRoots: ["/tmp/workspace"],

477-

}),

478-

);

472+

const options = expectSingleMattermostSend("channel:CHAN1", "hello");

473+

expect(options.mediaUrl).toBe("/tmp/workspace/image.png");

474+

expect(options.mediaLocalRoots).toStrictEqual(["/tmp/workspace"]);

479475

});

480476481477

it("threads resolved cfg on sendText", async () => {

@@ -498,14 +494,9 @@ describe("mattermostPlugin", () => {

498494499495

await sendText(params);

500496501-

expect(sendMessageMattermostMock).toHaveBeenCalledWith(

502-

"channel:CHAN1",

503-

"hello",

504-

expect.objectContaining({

505-

cfg,

506-

accountId: "default",

507-

}),

508-

);

497+

const options = expectSingleMattermostSend("channel:CHAN1", "hello");

498+

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

499+

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

509500

});

510501511502

it("uses threadId as fallback when replyToId is absent (sendText)", async () => {

@@ -522,14 +513,9 @@ describe("mattermostPlugin", () => {

522513523514

await sendText(params);

524515525-

expect(sendMessageMattermostMock).toHaveBeenCalledWith(

526-

"channel:CHAN1",

527-

"hello",

528-

expect.objectContaining({

529-

accountId: "default",

530-

replyToId: "post-root",

531-

}),

532-

);

516+

const options = expectSingleMattermostSend("channel:CHAN1", "hello");

517+

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

518+

expect(options.replyToId).toBe("post-root");

533519

});

534520535521

it("uses threadId as fallback when replyToId is absent (sendMedia)", async () => {

@@ -547,14 +533,9 @@ describe("mattermostPlugin", () => {

547533548534

await sendMedia(params);

549535550-

expect(sendMessageMattermostMock).toHaveBeenCalledWith(

551-

"channel:CHAN1",

552-

"caption",

553-

expect.objectContaining({

554-

accountId: "default",

555-

replyToId: "post-root",

556-

}),

557-

);

536+

const options = expectSingleMattermostSend("channel:CHAN1", "caption");

537+

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

538+

expect(options.replyToId).toBe("post-root");

558539

});

559540

});

560541