WTC-40: тест — пометка «Рецепта нет» только у блюд без рецепта
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
432eaf9482
commit
bf49091283
16
test/no-recipe-note.test.js
Normal file
16
test/no-recipe-note.test.js
Normal file
@ -0,0 +1,16 @@
|
||||
import test from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
import { messages } from "../src/i18n.js";
|
||||
import { findRecipe } from "../src/recipes.js";
|
||||
import { catalog } from "../src/catalog.js";
|
||||
// WTC-40: пометка «Рецепта нет» только у блюд без рецепта
|
||||
test("у своего блюда нет рецепта, пометка простыми словами", () => {
|
||||
assert.ok(!findRecipe("Моё секретное блюдо"));
|
||||
assert.match(messages.ru.noRecipe, /Рецепта для этого блюда пока нет/);
|
||||
assert.doesNotMatch(messages.ru.noRecipe, /null|undefined|error|ошибк/i);
|
||||
});
|
||||
test("у блюд с рецептом из базы пометки нет, будет кнопка «Рецепт»", () => {
|
||||
const names = Array.isArray(catalog) ? catalog : [];
|
||||
const withRecipe = names.filter((n) => findRecipe(n));
|
||||
assert.ok(withRecipe.length > 0);
|
||||
});
|
||||
Loading…
Reference in New Issue
Block a user