


























@@ -112,14 +112,12 @@ describe("commitments full-chain integration", () => {
112112if (!pendingCommitment) {
113113throw new Error("Expected pending commitment");
114114}
115-expect(pendingCommitment).toMatchObject({
116-status: "pending",
117-agentId: "main",
118- sessionKey,
119-channel: "telegram",
120-to: "155462274",
121-suggestedText: "How did the interview go?",
122-});
115+expect(pendingCommitment.status).toBe("pending");
116+expect(pendingCommitment.agentId).toBe("main");
117+expect(pendingCommitment.sessionKey).toBe(sessionKey);
118+expect(pendingCommitment.channel).toBe("telegram");
119+expect(pendingCommitment.to).toBe("155462274");
120+expect(pendingCommitment.suggestedText).toBe("How did the interview go?");
123121expect(pendingCommitment.dueWindow.earliestMs).toBe(dueMs);
124122expect(pendingCommitment).not.toHaveProperty("sourceUserText");
125123expect(pendingCommitment).not.toHaveProperty("sourceAssistantText");
@@ -161,21 +159,22 @@ describe("commitments full-chain integration", () => {
161159});
162160163161expect(result.status).toBe("ran");
164-expect(sendTelegram).toHaveBeenCalledWith(
165-"155462274",
166-"How did the interview go?",
167-expect.objectContaining({ accountId: "primary" }),
168-);
162+expect(sendTelegram).toHaveBeenCalledOnce();
163+const sendCall = sendTelegram.mock.calls[0];
164+if (!sendCall) {
165+throw new Error("Expected Telegram send call");
166+}
167+expect(sendCall[0]).toBe("155462274");
168+expect(sendCall[1]).toBe("How did the interview go?");
169+expect(sendCall[2]?.accountId).toBe("primary");
169170const deliveredStore = await loadCommitmentStore();
170171const [deliveredCommitment] = deliveredStore.commitments;
171172if (!deliveredCommitment) {
172173throw new Error("Expected delivered commitment");
173174}
174-expect(deliveredCommitment).toMatchObject({
175-status: "sent",
176-attempts: 1,
177-sentAtMs: dueMs + 60_000,
178-});
175+expect(deliveredCommitment.status).toBe("sent");
176+expect(deliveredCommitment.attempts).toBe(1);
177+expect(deliveredCommitment.sentAtMs).toBe(dueMs + 60_000);
179178});
180179});
181180});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。