diff --git a/test/empty-recipe-hint.test.js b/test/empty-recipe-hint.test.js new file mode 100644 index 0000000..76d6303 --- /dev/null +++ b/test/empty-recipe-hint.test.js @@ -0,0 +1,13 @@ +import test from "node:test"; +import assert from "node:assert/strict"; +import { readFileSync } from "node:fs"; +import { messages } from "../src/i18n.js"; + +// WTC-26: на пустом экране объяснено и про кнопку «Рецепт», и про «Рецепта нет» +test("Сценарий: Пустой экран объясняет оба случая", () => { + const app = readFileSync(new URL("../src/app.js", import.meta.url), "utf8"); + assert.match(app, /\$\("noRecipeHint"\)\.hidden = n !== 0 && !hasNoRecipe\(/); + assert.match(messages.ru.recipeExampleHint, /кнопка «Рецепт»/); + assert.match(messages.ru.noRecipeHint, /«Рецепта нет»/); + for (const l of ["ru", "kk", "en"]) assert.ok(messages[l].noRecipeHint.length > 20, l); +});