14 lines
833 B
JavaScript
14 lines
833 B
JavaScript
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);
|
||
});
|