Files
co-lite/solvway-admin-portal/app/lib/i18n/defaultMessages.test.ts
T
ngqileandClaude Opus 5.5 1071ddaa2a feat(admin-portal): cut babyboo portal down to Co-Lite login, users and roles
Removes every other screen, API route, component, test and the dependencies only
they used. Cookie colite_admin, Co-Lite branding, BO_USERS/BO_ROLES modules only.
The user form no longer loads branches, events or country scope.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
2026-11-26 21:24:30 +08:00

36 lines
1.4 KiB
TypeScript

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");
});
});