

























@@ -121,12 +121,10 @@ describe("commitment store delivery selection", () => {
121121).resolves.toStrictEqual([]);
122122123123const store = await loadCommitmentStore();
124-expect(store.commitments[0]).toMatchObject({
125-id: "cm_interview",
126-status: "expired",
127-expiredAtMs: nowMs,
128-updatedAtMs: nowMs,
129-});
124+expect(store.commitments[0]?.id).toBe("cm_interview");
125+expect(store.commitments[0]?.status).toBe("expired");
126+expect(store.commitments[0]?.expiredAtMs).toBe(nowMs);
127+expect(store.commitments[0]?.updatedAtMs).toBe(nowMs);
130128});
131129132130it("rewrites legacy source text fields when due commitments are listed", async () => {
@@ -146,14 +144,14 @@ describe("commitment store delivery selection", () => {
146144"utf8",
147145);
148146149-await expect(
150-listDueCommitmentsForSession({
151- cfg: { commitments: { enabled: true } },
152- agentId: "main",
153- sessionKey,
154- nowMs,
155- }),
156-).resolves.toEqual([expect.objectContaining({ id: "cm_interview" })]);
147+const dueCommitments = await listDueCommitmentsForSession({
148+cfg: { commitments: { enabled: true } },
149+agentId: "main",
150+sessionKey,
151+nowMs,
152+});
153+expect(dueCommitments).toHaveLength(1);
154+expect(dueCommitments[0]?.id).toBe("cm_interview");
157155158156const store = await loadCommitmentStore();
159157expect(store.commitments[0]).not.toHaveProperty("sourceUserText");
@@ -186,8 +184,9 @@ describe("commitment store delivery selection", () => {
186184 nowMs,
187185});
188186189-await expect(listCommitments({ status: "expired" })).resolves.toEqual([
190-expect.objectContaining({ id: "cm_interview", status: "expired" }),
191-]);
187+const expiredCommitments = await listCommitments({ status: "expired" });
188+expect(expiredCommitments).toHaveLength(1);
189+expect(expiredCommitments[0]?.id).toBe("cm_interview");
190+expect(expiredCommitments[0]?.status).toBe("expired");
192191});
193192});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。