From bed2ab568e3a5c2f0b3b2af02947fb7c102c9a8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Thu, 10 Sep 2026 01:09:50 +0200 Subject: [PATCH] fix(test): read the audit details as the string the writer stores `auditLog` serialises `details` with `JSON.stringify` into a text column, so the assertion was reading a field off a string and finding nothing. Refs #939 --- tests/integration/managed-profile-edit.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/integration/managed-profile-edit.test.ts b/tests/integration/managed-profile-edit.test.ts index 2832f8ae5..afb9fdcf0 100644 --- a/tests/integration/managed-profile-edit.test.ts +++ b/tests/integration/managed-profile-edit.test.ts @@ -216,9 +216,9 @@ describe("PATCH /api/managed-profiles/{id}", () => { where: { action: "managed_profile.updated", userId: profile.id }, }); expect(audit.actorUserId).toBe(guardian.id); - expect( - ((audit.details as { changed?: string[] } | null)?.changed ?? []).sort(), - ).toEqual(["displayName", "timezone"]); + // `auditLog` stores `details` as a JSON STRING, not as a Json column. + const details = JSON.parse(audit.details ?? "{}") as { changed?: string[] }; + expect((details.changed ?? []).sort()).toEqual(["displayName", "timezone"]); }); it("records the sex a Guardian sets, which is what the cycle module reads", async () => {