test(heartbeat): update runner tests to match current implementation

This commit is contained in:
Dinakar Sarbada
2026-02-16 12:11:09 -08:00
committed by Peter Steinberger
parent d35172cce5
commit 1953b938e3
2 changed files with 19 additions and 5 deletions

View File

@@ -116,6 +116,7 @@ describe("runHeartbeatOnce heartbeat model override", () => {
expect.objectContaining({
isHeartbeat: true,
heartbeatModelOverride: "ollama/llama3.2:1b",
suppressToolErrorWarnings: false,
}),
);
});

View File

@@ -544,8 +544,11 @@ describe("runHeartbeatOnce", () => {
expect.objectContaining({
Body: expect.stringMatching(/Ops check[\s\S]*Current time: /),
SessionKey: sessionKey,
From: "+1555",
To: "+1555",
Provider: "heartbeat",
}),
expect.objectContaining({ isHeartbeat: true }),
expect.objectContaining({ isHeartbeat: true, suppressToolErrorWarnings: false }),
cfg,
);
} finally {
@@ -621,8 +624,13 @@ describe("runHeartbeatOnce", () => {
expect(sendWhatsApp).toHaveBeenCalledTimes(1);
expect(sendWhatsApp).toHaveBeenCalledWith("+1555", "Final alert", expect.any(Object));
expect(replySpy).toHaveBeenCalledWith(
expect.objectContaining({ SessionKey: sessionKey }),
expect.objectContaining({ isHeartbeat: true }),
expect.objectContaining({
SessionKey: sessionKey,
From: "+1555",
To: "+1555",
Provider: "heartbeat",
}),
expect.objectContaining({ isHeartbeat: true, suppressToolErrorWarnings: false }),
cfg,
);
} finally {
@@ -699,8 +707,13 @@ describe("runHeartbeatOnce", () => {
expect(sendWhatsApp).toHaveBeenCalledTimes(1);
expect(sendWhatsApp).toHaveBeenCalledWith(groupId, "Group alert", expect.any(Object));
expect(replySpy).toHaveBeenCalledWith(
expect.objectContaining({ SessionKey: groupSessionKey }),
expect.objectContaining({ isHeartbeat: true }),
expect.objectContaining({
SessionKey: groupSessionKey,
From: groupId,
To: groupId,
Provider: "heartbeat",
}),
expect.objectContaining({ isHeartbeat: true, suppressToolErrorWarnings: false }),
cfg,
);
} finally {