import { describe, it, expect } from "vitest"; import { DEFAULT_MESSAGES } from "./defaultMessages"; import { resolveMessage } from "./t"; // Spec (add-sidebar-i18n-labels): "Every BO Code Has A Guaranteed English // Default" -- every BO_* code used by the sidebar must resolve to a readable // English label even when no DB message row exists, so the sidebar never // displays a raw code. describe("DEFAULT_MESSAGES BO_* floor", () => { it.each([ ["BO_USERS", "Users"], ["BO_ROLES", "Roles"], ])("%s resolves to %s via resolveMessage with an empty catalog", (code, expected) => { expect(resolveMessage({}, code)).toBe(expected); }); it("no longer defines BO_NAV_OTHER (module-id-category-order: no Other group)", () => { expect(Object.keys(DEFAULT_MESSAGES)).not.toContain("BO_NAV_OTHER"); }); it("includes BO_ROOT for completeness even though it is never rendered", () => { expect(DEFAULT_MESSAGES.BO_ROOT).toBe("Co-Lite admin"); }); }); describe("first sign-in copy", () => { it("no longer defines ResetCurrentPassword", () => { expect(DEFAULT_MESSAGES).not.toHaveProperty("ResetCurrentPassword"); }); it("defines ResetChooseIntro and drops the unused ResetIntro", () => { expect(DEFAULT_MESSAGES.ResetChooseIntro).toBe("Choose a new password to continue."); expect(DEFAULT_MESSAGES).not.toHaveProperty("ResetIntro"); }); });