17 lines
973 B
TypeScript
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/);
|
|
});
|