what-to-cook/test/mobile.test.js
Peppa 551ef95ffc
All checks were successful
peppa/lint lint: success за 0с
peppa/test test: success за 1с
peppa/build build: success за 0с
ci / checks (pull_request) Successful in 4s
deploy / deploy (pull_request) Successful in 13s
WTC-22: проверка экрана на телефоне, тест и спецификация
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-16 06:24:23 +05:00

18 lines
764 B
JavaScript

import test from "node:test";
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
const read = (f) => readFileSync(new URL(`../src/${f}`, import.meta.url), "utf8");
// WTC-22: удобство на телефоне
test("Сценарий: Основные кнопки на узком экране", () => {
assert.match(read("index.html"), /name="viewport" content="width=device-width, initial-scale=1"/);
const css = read("style.css");
assert.match(css, /body \{[^}]*font: 18px/);
assert.match(css, /button, input \{[^}]*min-height: 48px/);
});
test("Сценарий: Карточка рецепта на узком экране", () => {
assert.match(read("style.css"), /\.recipe \{[^}]*overflow-wrap: anywhere/);
});