From 0767673e19d7db038c8637e9f43f010690e2f066 Mon Sep 17 00:00:00 2001 From: Peppa Date: Mon, 16 Nov 2026 06:42:03 +0500 Subject: [PATCH] =?UTF-8?q?WTC-37:=20=D1=82=D0=B5=D1=81=D1=82=20=E2=80=94?= =?UTF-8?q?=20=D1=83=20=D1=81=D0=B2=D0=BE=D0=B8=D1=85=20=D0=B1=D0=BB=D1=8E?= =?UTF-8?q?=D0=B4=20=D0=BD=D0=B5=D1=82=20=D1=80=D0=B5=D1=86=D0=B5=D0=BF?= =?UTF-8?q?=D1=82=D0=B0,=20=D0=BF=D0=B5=D1=80=D0=B2=D1=8B=D0=B9=20=D1=8D?= =?UTF-8?q?=D0=BA=D1=80=D0=B0=D0=BD=20=D0=BE=D0=B1=20=D1=8D=D1=82=D0=BE?= =?UTF-8?q?=D0=BC=20=D0=B3=D0=BE=D0=B2=D0=BE=D1=80=D0=B8=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5.5 --- test/own-dish-no-recipe.test.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 test/own-dish-no-recipe.test.js diff --git a/test/own-dish-no-recipe.test.js b/test/own-dish-no-recipe.test.js new file mode 100644 index 0000000..7997509 --- /dev/null +++ b/test/own-dish-no-recipe.test.js @@ -0,0 +1,15 @@ +import test from "node:test"; +import assert from "node:assert/strict"; +import { readFileSync } from "node:fs"; +import { messages } from "../src/i18n.js"; +const read = (f) => readFileSync(new URL("../src/" + f, import.meta.url), "utf8"); +// WTC-37: первый экран предупреждает, что у своих блюд рецепта нет +test("пустой экран говорит, что рецепты есть только у блюд из базы", () => { + assert.match(messages.ru.noRecipeHint, /Рецепты есть только у блюд из базы/); + assert.match(read("app.js"), /\$\("noRecipeHint"\)\.hidden = n !== 0 && /); +}); +test("у своего блюда подпись вместо кнопки, карточка не открывается", () => { + const app = read("app.js"); + assert.match(app, /m\.textContent = t\.noRecipe/); + assert.match(app, /function openRecipe\(name, from\) \{\s*const r = findRecipe\(name\);\s*if \(!r\) return;/); +});