brendmanager/test/facts-legend.test.js
Peppa 401458664e
All checks were successful
peppa/lint lint: success за 1с
peppa/test test: success за 2с
ci / checks (pull_request) Successful in 7s
deploy / deploy (pull_request) Successful in 10s
BRM-111: расшифровка букв D/U/W/H/V в «Памяти бренда», пометка «проверить авторство»
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-17 23:14:33 +05:00

16 lines
867 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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