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.