14 lines
850 B
JavaScript
14 lines
850 B
JavaScript
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-33: подпись «Рецепта для этого блюда пока нет» в списке и в выдаче
|
|
test("подпись без рецепта есть в выдаче и в списке", () => {
|
|
assert.equal(messages.ru.noRecipe, "Рецепта для этого блюда пока нет");
|
|
for (const l of ["ru", "kk", "en"]) assert.ok(messages[l].noRecipe, l);
|
|
assert.match(read("index.html"), /id="noRecipeToday"/);
|
|
assert.match(read("app.js"), /\$\("noRecipeToday"\)\.hidden = !\(show && !findRecipe\(state\.last\)\)/);
|
|
assert.match(read("app.js"), /t\.noRecipe/);
|
|
});
|