import { describe, expect, it } from "vitest"; import { readMergedLocaleNamespace } from "~/utils/testing/repoPaths"; const DISCOVERY_KEYS = ["headline", "join", "joinAria", "memberCount_one", "memberCount_other"] as const; type DiscoveryTranslations = { chat: { channelList: { discover: Record<(typeof DISCOVERY_KEYS)[number], string>; }; }; }; function readTranslations(locale: "de" | "de-formal" | "en"): DiscoveryTranslations { return readMergedLocaleNamespace(locale, "translations"); } describe("AK-P15b public channel discovery translations", () => { it("ships the join contract in every supported locale", () => { for (const locale of ["de", "de-formal", "en"] as const) { const discover = readTranslations(locale).chat.channelList.discover; expect(Object.keys(discover)).toEqual(DISCOVERY_KEYS); for (const value of Object.values(discover)) expect(value.trim()).not.toBe(""); expect(discover.joinAria).toContain("{{channel}}"); expect(discover.memberCount_one).toContain("{{count}}"); expect(discover.memberCount_other).toContain("{{count}}"); } }); });