test: tighten discord threading utility assertions · openclaw/openclaw@3911058
shakkernerd
·
2026-05-11
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -245,9 +245,11 @@ describe("resolveDiscordPresenceUpdate", () => {
|
245 | 245 | |
246 | 246 | it("returns status-only presence when activity is omitted", () => { |
247 | 247 | const presence = resolveDiscordPresenceUpdate({ status: "dnd" }); |
248 | | -expect(presence).toMatchObject({ |
| 248 | +expect(presence).toEqual({ |
| 249 | +since: null, |
249 | 250 | status: "dnd", |
250 | 251 | activities: [], |
| 252 | +afk: false, |
251 | 253 | }); |
252 | 254 | }); |
253 | 255 | |
@@ -341,7 +343,8 @@ describe("resolveDiscordAutoThreadContext", () => {
|
341 | 343 | continue; |
342 | 344 | } |
343 | 345 | |
344 | | -expect(context, testCase.name).toMatchObject({ |
| 346 | +expect(context, testCase.name).toEqual({ |
| 347 | +createdThreadId: "thread", |
345 | 348 | To: "channel:thread", |
346 | 349 | From: "discord:channel:thread", |
347 | 350 | OriginatingTo: "channel:thread", |
@@ -350,6 +353,10 @@ describe("resolveDiscordAutoThreadContext", () => {
|
350 | 353 | channel: "discord", |
351 | 354 | peer: { kind: "channel", id: "thread" }, |
352 | 355 | }), |
| 356 | +ModelParentSessionKey: testCase.expectedModelParentSessionKey, |
| 357 | + ...(testCase.parentInheritanceEnabled === true |
| 358 | + ? { ParentSessionKey: testCase.expectedParentSessionKey } |
| 359 | + : {}), |
353 | 360 | }); |
354 | 361 | expect(context?.ParentSessionKey, testCase.name).toBe(testCase.expectedParentSessionKey); |
355 | 362 | expect(context?.ModelParentSessionKey, testCase.name).toBe( |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。