test: tighten signal silent ingest assertions · openclaw/openclaw@48ab469
shakkernerd
·
2026-05-11
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -66,15 +66,34 @@ describe("signal mention-skip silent ingest", () => {
|
66 | 66 | }), |
67 | 67 | ); |
68 | 68 | |
69 | | -expect(internalHookMocks.createInternalHookEvent).toHaveBeenCalledWith( |
70 | | -"message", |
71 | | -"received", |
72 | | -expect.stringContaining("signal"), |
73 | | -expect.objectContaining({ |
74 | | -channelId: "signal", |
75 | | -content: "hello without mention", |
76 | | -}), |
77 | | -); |
| 69 | +expect(internalHookMocks.createInternalHookEvent).toHaveBeenCalledTimes(1); |
| 70 | +const [type, action, sessionKey, context] = |
| 71 | +internalHookMocks.createInternalHookEvent.mock.calls[0] ?? []; |
| 72 | +expect(type).toBe("message"); |
| 73 | +expect(action).toBe("received"); |
| 74 | +expect(sessionKey).toContain("signal"); |
| 75 | +expect(context).toEqual({ |
| 76 | +from: "group:group-123", |
| 77 | +content: "hello without mention", |
| 78 | +timestamp: 1700000000000, |
| 79 | +channelId: "signal", |
| 80 | +accountId: "default", |
| 81 | +conversationId: "group:group-123", |
| 82 | +messageId: "1700000000000", |
| 83 | +metadata: { |
| 84 | +to: "group:group-123", |
| 85 | +provider: "signal", |
| 86 | +surface: "signal", |
| 87 | +threadId: undefined, |
| 88 | +senderId: "+15550001111", |
| 89 | +senderName: "Alice", |
| 90 | +senderUsername: undefined, |
| 91 | +senderE164: undefined, |
| 92 | +guildId: undefined, |
| 93 | +channelName: undefined, |
| 94 | +topicName: undefined, |
| 95 | +}, |
| 96 | +}); |
78 | 97 | expect(internalHookMocks.triggerInternalHook).toHaveBeenCalledTimes(1); |
79 | 98 | }); |
80 | 99 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。