From 3dfbf5af4360b9fce3ea8cb81dd7a378873cfc06 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 9 May 2026 20:50:37 +0100 Subject: [PATCH] test: tighten codex ci auth payload assertions --- src/scripts/prepare-codex-ci-auth.test.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/scripts/prepare-codex-ci-auth.test.ts b/src/scripts/prepare-codex-ci-auth.test.ts index 25cbc50b750..644d9c1b2f2 100644 --- a/src/scripts/prepare-codex-ci-auth.test.ts +++ b/src/scripts/prepare-codex-ci-auth.test.ts @@ -32,10 +32,9 @@ describe("prepare-codex-ci-auth", () => { }); expect(result.changed).toBe(true); - expect(decodeJwtPayload(String(result.auth.tokens?.id_token))).toMatchObject({ - email: "peter@example.com", - chatgpt_account_id: "acct_123", - }); + const payload = decodeJwtPayload(String(result.auth.tokens?.id_token)); + expect(payload.email).toBe("peter@example.com"); + expect(payload.chatgpt_account_id).toBe("acct_123"); }); it("leaves current auth metadata unchanged", () => { @@ -77,10 +76,9 @@ describe("prepare-codex-ci-auth", () => { const updated = JSON.parse(await fs.readFile(authPath, "utf-8")) as { tokens?: { id_token?: string }; }; - expect(decodeJwtPayload(String(updated.tokens?.id_token))).toMatchObject({ - sub: "user", - chatgpt_account_id: "acct_123", - }); + const payload = decodeJwtPayload(String(updated.tokens?.id_token)); + expect(payload.sub).toBe("user"); + expect(payload.chatgpt_account_id).toBe("acct_123"); }); }); });