Files
Jyotisha/frontend/tests/birth-time-mobile-scroll-contract.test.ts
T
Jesse_Chen 48a6f43b64
Independent Staging Quality Gate / validate (push) Successful in 13m32s
Independent Staging Quality Gate / publish (push) Successful in 9m8s
fix(ui): restore mobile scroll and theme layout
2026-08-15 16:25:39 +08:00

17 lines
973 B
TypeScript

import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import test from "node:test";
const css = readFileSync(new URL("../src/app/globals.css", import.meta.url), "utf8");
test("mobile rectification welcome content starts at the scroll origin", () => {
const centeredGrid = css.indexOf(".conversation.is-empty { display: grid");
const mobileOverride = css.indexOf(".conversation.is-empty {\n display: block", centeredGrid);
assert.ok(centeredGrid >= 0, "desktop empty state should remain centered");
assert.ok(mobileOverride > centeredGrid, "mobile display:block must be declared after the desktop grid rule");
assert.match(css, /\.conversation\s*\{[^}]*min-height:\s*0[^}]*overflow-y:\s*auto/);
assert.match(css.slice(mobileOverride), /\.conversation\.is-empty\s*\{[^}]*-webkit-overflow-scrolling:\s*touch/);
assert.match(css, /\.group\\\/sidebar-provider\[data-viewport\]\s*\{[^}]*height:\s*100vh;[^}]*height:\s*100dvh/);
});