mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-19 04:44:46 +00:00
test: verify infra outbound payloads
This commit is contained in:
@@ -93,11 +93,10 @@ describe("runHeartbeatOnce responsePrefix templates", () => {
|
||||
});
|
||||
|
||||
expect(sendTelegram).toHaveBeenCalledTimes(1);
|
||||
expect(sendTelegram).toHaveBeenCalledWith(
|
||||
TELEGRAM_GROUP,
|
||||
"[openai-codex/gpt-5.4|think:high] Heartbeat alert",
|
||||
expect.any(Object),
|
||||
);
|
||||
const [target, message, options] = sendTelegram.mock.calls[0] ?? [];
|
||||
expect(target).toBe(TELEGRAM_GROUP);
|
||||
expect(message).toBe("[openai-codex/gpt-5.4|think:high] Heartbeat alert");
|
||||
expect(typeof options).toBe("object");
|
||||
});
|
||||
|
||||
it("uses the resolved responsePrefix when suppressing prefixed HEARTBEAT_OK replies", async () => {
|
||||
|
||||
@@ -834,7 +834,7 @@ describe("runHeartbeatOnce", () => {
|
||||
replySpy,
|
||||
0,
|
||||
{
|
||||
Body: expect.stringMatching(/Ops check[\s\S]*Current time: /),
|
||||
Body: /Ops check[\s\S]*Current time: /,
|
||||
SessionKey: sessionKey,
|
||||
From: "120363401234567890@g.us",
|
||||
To: "120363401234567890@g.us",
|
||||
|
||||
@@ -156,11 +156,11 @@ describe("sendMessage channel normalization", () => {
|
||||
},
|
||||
},
|
||||
assertDeps: (deps: { localchat?: ReturnType<typeof vi.fn> }) => {
|
||||
expect(deps.localchat).toHaveBeenCalledWith(
|
||||
"someone@example.com",
|
||||
"hi",
|
||||
expect.any(Object),
|
||||
);
|
||||
expect(deps.localchat).toHaveBeenCalledTimes(1);
|
||||
const [to, text, options] = deps.localchat?.mock.calls[0] ?? [];
|
||||
expect(to).toBe("someone@example.com");
|
||||
expect(text).toBe("hi");
|
||||
expect(typeof options).toBe("object");
|
||||
},
|
||||
expectedChannel: "localchat",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user