mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-18 08:02:12 +00:00
Resolve plural tiers through the i18n context
Importing the plural helper directly from the dashboard trend tile cost ~78 KB gz across the route chunks: the module is tiny, but a new edge from a widely-instantiated component gets duplicated into every chunk that contains it rather than hoisted. The provider is already in every chunk, so expose a plural-aware tCount() there and let components call that instead. Total client JS goes back under budget. Also fix the two tests the honest-loading-state change invalidated: the mental-wellbeing landing tests seeded a never-resolving read and so now render skeletons rather than instrument cards, and the achievements page needs a router in scope for its module-gate redirect.
This commit is contained in:
1 parent
f31a12e174
commit
323b111a24
6 files changed
+119
-16
No files matched your search
@@ -25,6 +25,12 @@ import type { AchievementProgress } from "@/lib/gamification/achievements";
|
||||
* matching the `onboarding` page's existing test pattern.
|
||||
*/
|
||||
|
||||
// The page bounces a disabled-module direct hit to /insights (it used to
|
||||
// render a blank page), so the SSR render needs a router in scope.
|
||||
vi.mock("next/navigation", () => ({
|
||||
useRouter: () => ({ push: vi.fn(), replace: vi.fn(), prefetch: vi.fn() }),
|
||||
}));
|
||||
|
||||
vi.mock("@/hooks/use-auth", () => ({
|
||||
useAuth: () => ({
|
||||
isAuthenticated: true,
|
||||
|
||||
Reference in new issue
Block a user