WTC-37: тест — у своих блюд нет рецепта, первый экран об этом говорит
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
4755ceff8b
commit
0767673e19
15
test/own-dish-no-recipe.test.js
Normal file
15
test/own-dish-no-recipe.test.js
Normal file
@ -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;/);
|
||||
});
|
||||
Loading…
Reference in New Issue
Block a user