16 lines
867 B
JavaScript
16 lines
867 B
JavaScript
import test from "node:test";
|
||
import assert from "node:assert/strict";
|
||
import fs from "node:fs";
|
||
import { LEVELS } from "../src/facts.js";
|
||
|
||
// BRM-111: расшифровка букв D/U/W/H/V есть на странице и во всех языках.
|
||
test("BRM-111: у каждой буквы есть расшифровка на трёх языках, на странице — легенда", () => {
|
||
const html = fs.readFileSync(new URL("../public/facts.html", import.meta.url), "utf8");
|
||
for (const l of ["ru", "kk", "en"]) {
|
||
const d = JSON.parse(fs.readFileSync(new URL(`../locales/${l}.json`, import.meta.url), "utf8"));
|
||
for (const k of LEVELS) assert.ok(d["ui.facts.legend." + k].startsWith(k + " "), l + k);
|
||
assert.ok(d["ui.facts.authorship"]);
|
||
}
|
||
for (const k of LEVELS) assert.ok(html.includes(`data-t="ui.facts.legend.${k}"`));
|
||
});
|