import test from "node:test"; import assert from "node:assert/strict"; import { readFileSync } from "node:fs"; const html = readFileSync(new URL("../src/index.html", import.meta.url), "utf8"); const app = readFileSync(new URL("../src/app.js", import.meta.url), "utf8"); test("Сценарий: Пустой экран — скрытые кнопки убираются со страницы", () => { assert.match(app, /for \(const id of \["recipeToday", "easier", "harder", "back"\]\)/); assert.match(app, /conditional\[id\]\.replaceWith\(anchors\[id\]\)/); assert.match(app, /else if \(!on\) conditional\[id\]\.remove\(\)/); assert.match(app, /mount\("easier", n !== 0\)/); assert.match(app, /mount\("harder", n !== 0\)/); }); test("Сценарий: Поле ввода с подписью — подпись связана двумя способами", () => { assert.match(html, /