test: tighten mattermost inbound route assertion · openclaw/openclaw@41ccb85
shakkernerd
·
2026-05-11
·
via Recent Commits to openclaw:main
File tree
extensions/mattermost/src/mattermost
| Original file line number | Diff line number | Diff line change |
|---|
@@ -465,17 +465,20 @@ describe("mattermost inbound user posts", () => {
|
465 | 465 | socket.emitClose(1000); |
466 | 466 | await monitor; |
467 | 467 | |
468 | | -expect(runtimeCore.channel.session.recordInboundSession).toHaveBeenCalledWith( |
469 | | -expect.objectContaining({ |
470 | | -updateLastRoute: expect.objectContaining({ |
471 | | -channel: "mattermost", |
472 | | -to: "user:user-1", |
473 | | -mainDmOwnerPin: expect.objectContaining({ |
474 | | -ownerRecipient: "user-1", |
475 | | -senderRecipient: "user-1", |
476 | | -}), |
477 | | -}), |
478 | | -}), |
479 | | -); |
| 468 | +expect(runtimeCore.channel.session.recordInboundSession).toHaveBeenCalledTimes(1); |
| 469 | +const [recordCall] = runtimeCore.channel.session.recordInboundSession.mock.calls[0] ?? []; |
| 470 | +expect(recordCall?.storePath).toBe("/tmp/openclaw-test-sessions.json"); |
| 471 | +expect(recordCall?.sessionKey).toBe("mattermost:default:channel:chan-1"); |
| 472 | +const updateLastRoute = recordCall?.updateLastRoute; |
| 473 | +expect(updateLastRoute?.sessionKey).toBe("mattermost:default:channel:chan-1"); |
| 474 | +expect(updateLastRoute?.channel).toBe("mattermost"); |
| 475 | +expect(updateLastRoute?.to).toBe("user:user-1"); |
| 476 | +expect(updateLastRoute?.accountId).toBe("default"); |
| 477 | +expect(updateLastRoute?.mainDmOwnerPin?.ownerRecipient).toBe("user-1"); |
| 478 | +expect(updateLastRoute?.mainDmOwnerPin?.senderRecipient).toBe("user-1"); |
| 479 | +expect(typeof updateLastRoute?.mainDmOwnerPin?.onSkip).toBe("function"); |
| 480 | +expect(recordCall?.createIfMissing).toBeUndefined(); |
| 481 | +expect(recordCall?.groupResolution).toBeUndefined(); |
| 482 | +expect(recordCall?.onRecordError).toBeInstanceOf(Function); |
480 | 483 | }); |
481 | 484 | }); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。