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

推荐订阅源

B
Blog RSS Feed
J
Java Code Geeks
H
Help Net Security
Google DeepMind News
Google DeepMind News
博客园 - 司徒正美
Microsoft Security Blog
Microsoft Security Blog
宝玉的分享
宝玉的分享
Stack Overflow Blog
Stack Overflow Blog
D
DataBreaches.Net
The GitHub Blog
The GitHub Blog
S
SegmentFault 最新的问题
U
Unit 42
博客园 - 三生石上(FineUI控件)
Last Week in AI
Last Week in AI
M
MIT News - Artificial intelligence
WordPress大学
WordPress大学
小众软件
小众软件
博客园 - 叶小钗
D
Docker
量子位
P
Proofpoint News Feed
博客园_首页
T
Tailwind CSS Blog
F
Fortinet All Blogs

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 msteams graph search mock calls · openclaw/op...
steipete · 2026-05-12 · via Recent Commits to openclaw:main

@@ -17,6 +17,18 @@ beforeAll(async () => {

1717

({ searchMessagesMSTeams } = await loadGraphMessagesTestModule());

1818

});

191920+

function readFirstGraphPath(): string {

21+

const [call] = mockState.fetchGraphJson.mock.calls;

22+

if (!call) {

23+

throw new Error("Expected Graph fetch call");

24+

}

25+

const [request] = call;

26+

if (!request || typeof request !== "object" || typeof request.path !== "string") {

27+

throw new Error("Expected Graph fetch request path");

28+

}

29+

return request.path;

30+

}

31+2032

describe("searchMessagesMSTeams", () => {

2133

it("searches chat messages with query string", async () => {

2234

mockState.fetchGraphJson.mockResolvedValue({

@@ -44,7 +56,7 @@ describe("searchMessagesMSTeams", () => {

4456

createdAt: "2026-03-25T10:00:00Z",

4557

},

4658

]);

47-

const calledPath = mockState.fetchGraphJson.mock.calls[0][0].path as string;

59+

const calledPath = readFirstGraphPath();

4860

expect(calledPath).toContain(`/chats/${encodeURIComponent(CHAT_ID)}/messages?`);

4961

expect(calledPath).toContain("$search=");

5062

expect(calledPath).toContain("$top=25");

@@ -71,7 +83,7 @@ describe("searchMessagesMSTeams", () => {

7183

});

72847385

expect(result.messages).toHaveLength(1);

74-

const calledPath = mockState.fetchGraphJson.mock.calls[0][0].path as string;

86+

const calledPath = readFirstGraphPath();

7587

expect(calledPath).toContain("/teams/team-id-1/channels/channel-id-1/messages?");

7688

});

7789

@@ -85,7 +97,7 @@ describe("searchMessagesMSTeams", () => {

8597

limit: 10,

8698

});

879988-

const calledPath = mockState.fetchGraphJson.mock.calls[0][0].path as string;

100+

const calledPath = readFirstGraphPath();

89101

expect(calledPath).toContain("$top=10");

90102

});

91103

@@ -99,7 +111,7 @@ describe("searchMessagesMSTeams", () => {

99111

limit: 100,

100112

});

101113102-

const calledPath = mockState.fetchGraphJson.mock.calls[0][0].path as string;

114+

const calledPath = readFirstGraphPath();

103115

expect(calledPath).toContain("$top=50");

104116

});

105117

@@ -113,7 +125,7 @@ describe("searchMessagesMSTeams", () => {

113125

limit: 0,

114126

});

115127116-

const calledPath = mockState.fetchGraphJson.mock.calls[0][0].path as string;

128+

const calledPath = readFirstGraphPath();

117129

expect(calledPath).toContain("$top=1");

118130

});

119131

@@ -127,7 +139,7 @@ describe("searchMessagesMSTeams", () => {

127139

from: "Alice",

128140

});

129141130-

const calledPath = mockState.fetchGraphJson.mock.calls[0][0].path as string;

142+

const calledPath = readFirstGraphPath();

131143

expect(calledPath).toContain("$filter=");

132144

const decoded = decodeURIComponent(calledPath);

133145

expect(decoded).toContain("from/user/displayName eq 'Alice'");

@@ -143,7 +155,7 @@ describe("searchMessagesMSTeams", () => {

143155

from: "O'Brien",

144156

});

145157146-

const calledPath = mockState.fetchGraphJson.mock.calls[0][0].path as string;

158+

const calledPath = readFirstGraphPath();

147159

const decoded = decodeURIComponent(calledPath);

148160

expect(decoded).toContain("O''Brien");

149161

});

@@ -157,7 +169,7 @@ describe("searchMessagesMSTeams", () => {

157169

query: 'say "hello" world',

158170

});

159171160-

const calledPath = mockState.fetchGraphJson.mock.calls[0][0].path as string;

172+

const calledPath = readFirstGraphPath();

161173

const decoded = decodeURIComponent(calledPath);

162174

expect(decoded).toContain('$search="say hello world"');

163175

expect(decoded).not.toContain('""');

@@ -207,7 +219,7 @@ describe("searchMessagesMSTeams", () => {

207219

});

208220209221

expect(mockState.findPreferredDmByUserId).toHaveBeenCalledWith("aad-user-1");

210-

const calledPath = mockState.fetchGraphJson.mock.calls[0][0].path as string;

222+

const calledPath = readFirstGraphPath();

211223

expect(calledPath).toContain(

212224

`/chats/${encodeURIComponent("19:dm-chat@thread.tacv2")}/messages?`,

213225

);