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

推荐订阅源

博客园 - 聂微东
宝玉的分享
宝玉的分享
Apple Machine Learning Research
Apple Machine Learning Research
罗磊的独立博客
Last Week in AI
Last Week in AI
WordPress大学
WordPress大学
博客园 - 【当耐特】
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
博客园 - 司徒正美
博客园 - Franky
爱范儿
爱范儿
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
Tailwind CSS Blog
Hugging Face - Blog
Hugging Face - Blog
Jina AI
Jina AI
量子位
博客园 - 叶小钗
博客园_首页
月光博客
月光博客
博客园 - 三生石上(FineUI控件)
The Cloudflare Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报

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 interaction callback assertions ...
shakkernerd · 2026-05-11 · via Recent Commits to openclaw:main

@@ -857,17 +857,21 @@ describe("createMattermostInteractionHandler", () => {

857857

post: fetchedPost,

858858

});

859859

expect(enqueueSystemEvent).toHaveBeenCalledWith(

860-

expect.stringContaining('Mattermost button click: action="approve"'),

861-

expect.objectContaining({ sessionKey: "session:thread:root-9" }),

862-

);

863-

expect(dispatchButtonClick).toHaveBeenCalledWith(

864-

expect.objectContaining({

865-

channelId: "chan-1",

866-

userId: "user-1",

867-

postId: "post-1",

868-

post: fetchedPost,

869-

}),

860+

'Mattermost button click: action="approve" by alice in channel chan-1',

861+

{

862+

sessionKey: "session:thread:root-9",

863+

contextKey: "mattermost:interaction:post-1:approve",

864+

},

870865

);

866+

expect(dispatchButtonClick).toHaveBeenCalledWith({

867+

channelId: "chan-1",

868+

userId: "user-1",

869+

userName: "alice",

870+

actionId: "approve",

871+

actionName: "Approve",

872+

postId: "post-1",

873+

post: fetchedPost,

874+

});

871875

});

872876873877

it("lets a custom interaction handler short-circuit generic completion updates", async () => {

@@ -877,45 +881,45 @@ describe("createMattermostInteractionHandler", () => {

877881

ephemeral_text: "Only the original requester can use this picker.",

878882

});

879883

const dispatchButtonClick = vi.fn();

884+

const originalPost = createActionPost({

885+

actionId: "mdlprov",

886+

actionName: "Browse providers",

887+

});

880888

const handler = createMattermostInteractionHandler({

881889

client: createMattermostClientMock(async (path: string, init?: { method?: string }) => {

882890

requestLog.push({ path, method: init?.method });

883-

return createActionPost({

884-

actionId: "mdlprov",

885-

actionName: "Browse providers",

886-

});

891+

return originalPost;

887892

}),

888893

botUserId: "bot",

889894

accountId: "acct",

890895

handleInteraction,

891896

dispatchButtonClick,

892897

});

893-894-

const res = await runHandler(handler, {

895-

body: createInteractionBody({

896-

context,

897-

token,

898-

userId: "user-2",

899-

userName: "alice",

900-

}),

898+

const body = createInteractionBody({

899+

context,

900+

token,

901+

userId: "user-2",

902+

userName: "alice",

901903

});

902904905+

const res = await runHandler(handler, { body });

906+903907

expect(res.statusCode).toBe(200);

904908

expect(res.body).toBe(

905909

JSON.stringify({

906910

ephemeral_text: "Only the original requester can use this picker.",

907911

}),

908912

);

909913

expect(requestLog).toEqual([{ path: "/posts/post-1", method: undefined }]);

910-

expect(handleInteraction).toHaveBeenCalledWith(

911-

expect.objectContaining({

912-

actionId: "mdlprov",

913-

actionName: "Browse providers",

914-

originalMessage: "Choose",

915-

post: expect.objectContaining({ id: "post-1" }),

916-

userName: "alice",

917-

}),

918-

);

914+

expect(handleInteraction).toHaveBeenCalledWith({

915+

payload: body,

916+

userName: "alice",

917+

actionId: "mdlprov",

918+

actionName: "Browse providers",

919+

originalMessage: "Choose",

920+

context,

921+

post: originalPost,

922+

});

919923

expect(dispatchButtonClick).not.toHaveBeenCalled();

920924

});

921925

});