what-to-cook/test/own-dish-note.test.js
2026-11-16 06:51:28 +05:00

14 lines
744 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import test from "node:test";
import assert from "node:assert/strict";
import { findRecipe } from "../src/recipes.js";
import { messages } from "../src/i18n.js";
// WTC-43: пометка только у своего блюда, у блюд из базы — кнопка «Рецепт»
test("у блюд из базы есть рецепт, у своего блюда нет", () => {
for (const n of ["Плов", "Бешбармак", "Борщ"]) assert.ok(findRecipe(n), n);
assert.ok(!findRecipe("Мамин пирог"));
});
test("пометка короткая и без технических слов", () => {
assert.match(messages.ru.noRecipe, /Рецепта .*нет/);
assert.ok(messages.ru.noRecipe.length < 50);
});