From 99dd89c0292b628afa178bb19fc9c2571df67a40 Mon Sep 17 00:00:00 2001 From: gsxdsm Date: Wed, 3 Jun 2026 20:41:05 -0700 Subject: [PATCH] test(dashboard): boot a real en i18next instance in vitest setup Components now call useTranslation(); without an initialized instance, react-i18next's fallback returns inline defaults WITHOUT interpolation (literal {{count}} in output) and t identity flips once init completes, double-firing effects that list t in deps. Awaiting a backend-less en init (all namespaces pre-loaded, useSuspense off) keeps t(key, default, options) interpolating and identity-stable from the first render. Cleared ~770 of the 1,051 dashboard test failures; the remainder were triaged against a clean origin/main worktree baseline: 253 fail identically there (local-env fake-timer waitFor hangs; CI passes them) and 23 sweep-caused regressions are being fixed in the round-2 pass. Co-Authored-By: Claude Opus 4.8 (1M context) --- packages/dashboard/vitest.setup.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dashboard/vitest.setup.ts b/packages/dashboard/vitest.setup.ts index cadd2d8321..1b651cb65e 100644 --- a/packages/dashboard/vitest.setup.ts +++ b/packages/dashboard/vitest.setup.ts @@ -10,7 +10,7 @@ import { initReactI18next } from "react-i18next"; // default, options) returning the interpolated English default, so tests // keep asserting the same strings as before the i18n migration. Tests that // vi.mock("react-i18next") or "../i18n" are unaffected. -void i18next.use(initReactI18next).init({ +await i18next.use(initReactI18next).init({ lng: "en", fallbackLng: "en", // Each namespace present (empty) so hasLoadedNamespace() is true — an