diff --git a/src/components/measurement-reminders/__tests__/vorsorge-section.test.tsx b/src/components/measurement-reminders/__tests__/vorsorge-section.test.tsx index 8bd47bdce..691508ff2 100644 --- a/src/components/measurement-reminders/__tests__/vorsorge-section.test.tsx +++ b/src/components/measurement-reminders/__tests__/vorsorge-section.test.tsx @@ -89,6 +89,21 @@ describe(" loading + empty", () => { expect(html).not.toContain('data-slot="empty-state"'); }); + it("surfaces a read failure through the shared query-error primitive with retry", () => { + remindersMock.mockReturnValue({ + data: undefined, + isLoading: false, + isError: true, + refetch: vi.fn(), + }); + const html = render(); + expect(html).toContain('data-slot="query-error-row"'); + expect(html).toContain('data-slot="query-error-row-retry"'); + // Not the empty state, and no longer the muted bespoke row. + expect(html).not.toContain('data-slot="empty-state"'); + expect(html).not.toContain('data-slot="vorsorge-error"'); + }); + it("routes the no-data case through the shared EmptyState with an action", () => { remindersMock.mockReturnValue({ data: [], isLoading: false }); const html = render(); diff --git a/src/components/measurement-reminders/vorsorge-section.tsx b/src/components/measurement-reminders/vorsorge-section.tsx index 4aa1b1c03..118560d83 100644 --- a/src/components/measurement-reminders/vorsorge-section.tsx +++ b/src/components/measurement-reminders/vorsorge-section.tsx @@ -38,7 +38,6 @@ import { CalendarPlus, CheckCircle2, Plus, - RefreshCw, Wrench, } from "lucide-react"; @@ -76,6 +75,7 @@ import { } from "@/components/ui/dropdown-menu"; import { DateField } from "@/components/ui/date-field"; import { EmptyState } from "@/components/ui/empty-state"; +import { QueryErrorRow } from "@/components/ui/query-error-row"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { LineChart, MoreVertical, Pencil, Trash2 } from "lucide-react"; @@ -703,23 +703,10 @@ export function VorsorgeSection({ )} {!isLoading && isError && ( -
- {t("measurementReminders.loadError")} - -
+ void refetch()} + /> )} {!isLoading && !isError && (reminders?.length ?? 0) === 0 && (