32 lines
1.1 KiB
JavaScript
32 lines
1.1 KiB
JavaScript
import assert from "node:assert/strict";
|
|
import { readFileSync } from "node:fs";
|
|
import { dirname, join } from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
const css = readFileSync(join(__dirname, "..", "styles.css"), "utf8");
|
|
|
|
assert.match(
|
|
css,
|
|
/@media\s*\(max-width:\s*720px\)[\s\S]*\.home-topbar\s*\{[\s\S]*position:\s*static;/,
|
|
"mobile home topbar should not remain sticky and tall above the content",
|
|
);
|
|
|
|
assert.match(
|
|
css,
|
|
/@media\s*\(max-width:\s*720px\)[\s\S]*\.home-topbar\s+\.top-actions\s*\{[\s\S]*display:\s*grid;[\s\S]*grid-template-columns:\s*minmax\(0,\s*1fr\)\s+auto;/,
|
|
"mobile top actions should keep search and account controls compact",
|
|
);
|
|
|
|
assert.match(
|
|
css,
|
|
/@media\s*\(max-width:\s*720px\)[\s\S]*\.home-metrics\s*\{[\s\S]*grid-template-columns:\s*1fr;/,
|
|
"mobile dashboard metrics should use one readable column",
|
|
);
|
|
|
|
assert.match(
|
|
css,
|
|
/\.home-favorite\s*\{[\s\S]*min-width:\s*44px;[\s\S]*min-height:\s*44px;/,
|
|
"favorite buttons should meet mobile touch target sizing",
|
|
);
|