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) <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-06-03 20:41:05 -07:00
parent 1e49494bac
commit 99dd89c029

View File

@@ -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