From ac482047f5331c2ca5fd0876ac7235c02b1bf1e2 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 10 May 2026 00:10:39 +0100 Subject: [PATCH] test: tighten dreaming cron migration assertions --- ...tor-cron-dreaming-payload-migration.test.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/commands/doctor-cron-dreaming-payload-migration.test.ts b/src/commands/doctor-cron-dreaming-payload-migration.test.ts index 9f2f3755ed9..731db39d5dd 100644 --- a/src/commands/doctor-cron-dreaming-payload-migration.test.ts +++ b/src/commands/doctor-cron-dreaming-payload-migration.test.ts @@ -39,18 +39,20 @@ describe("migrateLegacyDreamingPayloadShape", () => { const jobs = [staleDreamingJob()]; const result = migrateLegacyDreamingPayloadShape(jobs); expect(result).toEqual({ changed: true, rewrittenCount: 1 }); - expect(jobs[0]).toMatchObject({ - sessionTarget: "isolated", - payload: { kind: "agentTurn", message: DREAMING_TOKEN, lightContext: true }, - delivery: { mode: "none" }, + expect(jobs[0]?.sessionTarget).toBe("isolated"); + expect(jobs[0]?.payload).toEqual({ + kind: "agentTurn", + message: DREAMING_TOKEN, + lightContext: true, }); + expect(jobs[0]?.delivery).toEqual({ mode: "none" }); }); it("identifies the managed job by description tag even when name was edited", () => { - const jobs = [{ ...staleDreamingJob(), name: "Custom Name" }]; + const jobs: Array> = [{ ...staleDreamingJob(), name: "Custom Name" }]; const result = migrateLegacyDreamingPayloadShape(jobs); expect(result.rewrittenCount).toBe(1); - expect(jobs[0]).toMatchObject({ sessionTarget: "isolated" }); + expect(jobs[0]?.sessionTarget).toBe("isolated"); }); it("identifies the managed job by name + payload token when description tag is missing", () => { @@ -131,8 +133,8 @@ describe("migrateLegacyDreamingPayloadShape", () => { ] as Array>; const result = migrateLegacyDreamingPayloadShape(jobs); expect(result).toEqual({ changed: true, rewrittenCount: 1 }); - expect(jobs[0]).toMatchObject({ sessionTarget: "isolated" }); - expect(jobs[1]).toMatchObject({ sessionTarget: "main" }); + expect(jobs[0]?.sessionTarget).toBe("isolated"); + expect(jobs[1]?.sessionTarget).toBe("main"); expect(jobs[2]).toEqual(migratedDreamingJob()); }); });