Track HiveGrid Cloud planning reference
This commit is contained in:
1 parent
b3d5ea6764
commit
e341c5938a
5784 files changed
+1104929
-3
No files matched your search
@@ -0,0 +1,30 @@
|
||||
import { describe, expect, test } from "vitest";
|
||||
|
||||
import i18next from "i18next";
|
||||
|
||||
import { ensureServerGlobalI18n, syncServerGlobalI18nLanguage } from "./i18next.global.server";
|
||||
|
||||
describe("server global i18next bootstrap", () => {
|
||||
test("initialises the global instance with preloaded resources", async () => {
|
||||
await ensureServerGlobalI18n();
|
||||
expect(i18next.isInitialized).toBe(true);
|
||||
// The sidebar toggle label is the canonical string that previously rendered
|
||||
// empty during SSR (causing button-name a11y failures + hydration #418).
|
||||
expect(i18next.t("components.sidebar.toggle")).not.toBe("");
|
||||
expect(i18next.t("components.sidebar.toggle")).not.toBe("components.sidebar.toggle");
|
||||
});
|
||||
|
||||
test("aligns the global language with the requested locale", async () => {
|
||||
await syncServerGlobalI18nLanguage("en");
|
||||
expect(i18next.language).toBe("en");
|
||||
const en = i18next.t("components.sidebar.toggle");
|
||||
|
||||
await syncServerGlobalI18nLanguage("de");
|
||||
expect(i18next.language).toBe("de");
|
||||
const de = i18next.t("components.sidebar.toggle");
|
||||
|
||||
expect(en).not.toBe("");
|
||||
expect(de).not.toBe("");
|
||||
expect(de).not.toBe(en);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user