test(whatsapp): align direct last-route envelope · openclaw/openclaw@9ed1766
steipete
·
2026-06-01
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import "./test-helpers.js"; |
2 | | -import { formatInboundEnvelope } from "openclaw/plugin-sdk/channel-inbound"; |
3 | 2 | import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts"; |
4 | 3 | import { beforeEach, describe, expect, it, vi } from "vitest"; |
5 | 4 | import { |
@@ -151,17 +150,6 @@ describe("web auto-reply last-route", () => {
|
151 | 150 | to: "+1000", |
152 | 151 | accountId: "default", |
153 | 152 | }); |
154 | | -const body = formatInboundEnvelope({ |
155 | | -channel: "WhatsApp", |
156 | | -from: "+1000", |
157 | | -timestamp: now, |
158 | | -body: "hello", |
159 | | -chatType: "direct", |
160 | | -sender: { |
161 | | -e164: "+1000", |
162 | | -id: "+1000", |
163 | | -}, |
164 | | -}); |
165 | 153 | expect(ctx).toMatchObject({ |
166 | 154 | From: "+1000", |
167 | 155 | To: "+2000", |
@@ -178,7 +166,7 @@ describe("web auto-reply last-route", () => {
|
178 | 166 | SenderE164: "+1000", |
179 | 167 | SenderId: "+1000", |
180 | 168 | RawBody: "hello", |
181 | | -Body: body, |
| 169 | +Body: expect.stringMatching(/^\[WhatsApp \+1000 .+\] hello$/), |
182 | 170 | BodyForAgent: "hello", |
183 | 171 | CommandBody: "hello", |
184 | 172 | Timestamp: now, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。