Problem
Dashboard.tsx passes stats || mockUserStats into StatsCard, so contributors and players see fabricated numbers whenever statsApi.getUserStats() returns null or before the fetch completes. The component header still carries a stale ISSUE comment about wiring live stats even though the fetch path already exists.
Scope
- Stop silently substituting
mockUserStats in the dashboard stats panel
- Show an honest empty or retry state when live stats are unavailable
- Keep mock fixtures for tests/Storybook only (not production UI fallback)
- Update
Dashboard.test.tsx expectations accordingly
Acceptance criteria
Files
src/pages/Dashboard.tsx
src/components/StatsCard.tsx
src/pages/Dashboard.test.tsx
src/data/mockData.ts (tests only)
Difficulty
intermediate
Problem
Dashboard.tsxpassesstats || mockUserStatsintoStatsCard, so contributors and players see fabricated numbers wheneverstatsApi.getUserStats()returnsnullor before the fetch completes. The component header still carries a staleISSUEcomment about wiring live stats even though the fetch path already exists.Scope
mockUserStatsin the dashboard stats panelDashboard.test.tsxexpectations accordinglyAcceptance criteria
null/error response shows empty/error UI (no mock numbers)pnpm testandpnpm buildpassFiles
src/pages/Dashboard.tsxsrc/components/StatsCard.tsxsrc/pages/Dashboard.test.tsxsrc/data/mockData.ts(tests only)Difficulty
intermediate