import test from "node:test"; import assert from "node:assert/strict"; import { readFileSync } from "node:fs"; import { messages } from "../src/i18n.js"; const html = readFileSync(new URL("../src/index.html", import.meta.url), "utf8"); test("Сценарий: каждая кнопка в разметке имеет подпись без скриптов", () => { const buttons = [...html.matchAll(/]*>([^<]*)<\/button>/g)]; assert.equal(buttons.length, 6); for (const [, text] of buttons) assert.ok(text.trim().length > 0); }); test("Сценарий: подписи в разметке совпадают с русскими текстами", () => { const m = messages.ru; for (const s of [m.add, m.pick, m.easier, m.harder, m.back, m.recipe, m.nameLabel]) { assert.ok(html.includes(`>${s}<`), s); } });