From 73b82f444ec5eb62a7c9828b096c6f06200af255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sun, 9 Aug 2026 04:37:03 +0200 Subject: [PATCH] test: use render thunks in the read-error family suites for the jsx-key rule --- .../__tests__/admin-read-error-family.test.tsx | 10 +++++----- .../settings-read-error-family.test.tsx | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/components/admin/__tests__/admin-read-error-family.test.tsx b/src/components/admin/__tests__/admin-read-error-family.test.tsx index cece02147..dd046b785 100644 --- a/src/components/admin/__tests__/admin-read-error-family.test.tsx +++ b/src/components/admin/__tests__/admin-read-error-family.test.tsx @@ -29,15 +29,15 @@ function render(node: React.ReactNode) { ); } -const cases: Array<[string, React.ReactNode]> = [ - ["RecentAuditPreview", ], - ["CoachFeedbackSection", ], - ["AiQualitySection", ], +const cases: Array<[string, () => React.ReactNode]> = [ + ["RecentAuditPreview", () => ], + ["CoachFeedbackSection", () => ], + ["AiQualitySection", () => ], ]; describe("admin read-error family — a read failure is foreground and recoverable", () => { it.each(cases)("%s renders a query-error row with retry", (_name, node) => { - const html = render(node); + const html = render(node()); expect(html).toContain('data-slot="query-error-row"'); expect(html).toContain('data-slot="query-error-row-retry"'); expect(html).not.toContain("bg-destructive/10"); diff --git a/src/components/settings/__tests__/settings-read-error-family.test.tsx b/src/components/settings/__tests__/settings-read-error-family.test.tsx index 4a3bffd11..06b07fea9 100644 --- a/src/components/settings/__tests__/settings-read-error-family.test.tsx +++ b/src/components/settings/__tests__/settings-read-error-family.test.tsx @@ -45,18 +45,18 @@ function renderCard(node: React.ReactNode) { ); } -const cases: Array<[string, React.ReactNode]> = [ - ["SecuritySessionsCard", ], - ["SecurityActivityCard", ], - ["TrustedDevicesCard", ], - ["CoachMemorySection", ], - ["CoachRemindersSection", ], - ["AboutMeSection", ], +const cases: Array<[string, () => React.ReactNode]> = [ + ["SecuritySessionsCard", () => ], + ["SecurityActivityCard", () => ], + ["TrustedDevicesCard", () => ], + ["CoachMemorySection", () => ], + ["CoachRemindersSection", () => ], + ["AboutMeSection", () => ], ]; describe("settings read-error family — a read failure is foreground and recoverable", () => { it.each(cases)("%s renders a query-error row with retry", (_name, node) => { - const html = renderCard(node); + const html = renderCard(node()); expect(html).toContain('data-slot="query-error-row"'); expect(html).toContain('data-slot="query-error-row-retry"'); // No bare red line: the alert is the primitive now.