WTC-26: подсказка про «Рецепта нет» и на пустом экране

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Peppa 2026-11-16 06:28:33 +05:00
parent 49afcb5a32
commit 7b978cfa8c

View File

@ -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);
});