// Catalog completeness — the CLJS replacement for the TS-era MsgKey type
// check: every EN key must exist in ro/hu (a missing translation fails the
// suite), no stray keys, and the plural shapes carry the documented variants.
import test from "node:test";
import assert from "node:assert/strict";
import * as lib from "../test-dist/testlib.js";
const en = [...lib.catalogKeys("en")];
test("EN catalog is non-empty and carries the social.* block", () => {
assert.ok(en.length >= 40);
assert.ok(en.some((k) => k.startsWith("social.")));
});
for (const lang of ["ro", "hu"]) {
test(`${lang} covers every EN key, and nothing else`, () => {
assert.deepEqual([...lib.catalogKeys(lang)], en);
});
}
test("plural sites: ro one/few/other, hu other-only, en one/other", () => {
assert.deepEqual([...lib.catalogMsg("en", "status.linked")], ["one", "other"]);
assert.deepEqual([...lib.catalogMsg("ro", "status.linked")], ["few", "one", "other"]);
assert.deepEqual([...lib.catalogMsg("hu", "status.linked")], ["other"]);
});
test("wire-adjacent strings are never translated (brand + protocol)", () => {
// tap zones and brand names may translate; message KEYS must be identical —
// covered above — and no catalog value may contain the protocol prefix.
for (const lang of ["en", "ro", "hu"]) {
for (const k of lib.catalogKeys(lang)) {
const m = lib.catalogMsg(lang, k);
if (typeof m === "string") assert.ok(!m.includes("/neon-grid/"), `${lang} ${k}`);
}
}
});