Issue: Add component tests for RecoveryTimeline Status: Complete
RecoveryTimelineList and RecoveryTimelineEvent already had large test suites. This
change closes the remaining gaps called out in the issue's acceptance criteria — the
tests were still on the legacy jest.* global shim, and there was no coverage
proving the mobile-first responsive classes actually render, which is the main
signal the codebase has for "verify on a narrow mobile viewport" since Tailwind
breakpoints aren't otherwise exercised by jsdom.
- Replaced
jest.fn()withvi.fn()and added an explicitimport { vi } from "vitest", removing the file's last dependency on the globaljestcompatibility shim insrc/test/setup.tsx. - Added a
Responsive layout (narrow mobile viewport)block asserting:- the title/description/timestamp row is
flex-colby default and only becomessm:flex-rowfrom thesmbreakpoint up - the dot/content gap is tighter on mobile (
gap-2) than on larger screens (sm:gap-4) - the timestamp keeps
whitespace-nowrapso it can't collapse the row on narrow screens
- the title/description/timestamp row is
- Same
jest.fn()→vi.fn()migration. - Added a matching
Responsive layout (narrow mobile viewport)block covering:- the progress header stacking (
flex-col→sm:flex-row) - the statistics grid collapsing to one column on mobile and three from
smup - the empty state using reduced padding (
p-4→sm:p-8) on narrow screens
- the progress header stacking (
- Load a recovery flow with the timeline on a desktop-width viewport — events render title/description/timestamp on one row, stats in a 3-column grid.
- Resize to a narrow (< 640px) viewport — content stacks vertically, timestamp stays on one line, empty state padding shrinks, no horizontal scroll.
- Confirm keyboard navigation (Arrow keys, Home/End, Enter/Space) still works at both widths — unaffected by this change but re-verified alongside it.
- Confirm dashboard navigation surrounding the recovery timeline is unaffected.
No production code changed — this is test-only coverage.