layouts
All repositories: gitoria
26.7 KB
// tests/browser.mjs — THE GATE of layouts.worldapi.org: its own server, real headless Chrome, real clicks.// node tests/browser.mjs (LAYOUTS_GATE_PORT server, default 8760; LAYOUTS_GATE_CHROME "8761-8764" = Chrome debug ports;// 8765/8766 are foreign on Loreana — never use them)// What it proves, at 390 and 1280 px: the three shells and their states (list-first item → detail → back; three-pane all three// on desktop, list → detail on the phone; the sidebar overlay and the search + user menu popovers open and close), the header// flush with the content column, no sideways scroll, the themed components without decorative frames, the accent switcher,// the theme gate helper, and no console errors. Screenshots land in .scratch/gate-*.png — LOOK at them.import { spawn, execFileSync } from 'node:child_process';import { writeFileSync, existsSync, mkdirSync, rmSync } from 'node:fs';import { dirname, join, resolve } from 'node:path';import { fileURLToPath } from 'node:url';import { launchBrowser } from './cdp.mjs';if (!process.env.HL_CHROME && existsSync('/opt/google/chrome/chrome')) process.env.HL_CHROME = '/opt/google/chrome/chrome';const APP = resolve(dirname(fileURLToPath(import.meta.url)), '..');const PORT = Number(process.env.LAYOUTS_GATE_PORT || 8760);const [CH_FROM, CH_TO] = (process.env.LAYOUTS_GATE_CHROME || '8761-8764').split('-').map(Number);const BASE = `http://127.0.0.1:${PORT}`;const SCRATCH = join(APP, '.scratch');mkdirSync(SCRATCH, { recursive: true });for (const f of ['gate-shots']) rmSync(join(SCRATCH, f), { recursive: true, force: true });const SHOTS = join(SCRATCH, 'gate-shots');mkdirSync(SHOTS, { recursive: true });let failures = 0, passes = 0;function check(label, ok, detail = '') {console.log(`${ok ? 'ok ' : 'FAIL'} ${label}${ok ? '' : ' — ' + detail}`);if (ok) passes++; else failures++;}const sleep = (ms) => new Promise(r => setTimeout(r, ms));let log = '', server = null, browser = null;async function startServer() {server = spawn(join(APP, 'bin/hybriel'), ['project.hl'], { cwd: APP, env: { ...process.env, LAYOUTS_PORT: String(PORT), LAYOUTS_WATCH: '0' }, stdio: ['ignore', 'pipe', 'pipe'] });server.stdout.on('data', d => log += d); server.stderr.on('data', d => log += d);for (let i = 0; ; i++) {try { if ((await fetch(BASE + '/')).ok) break; } catch {}if (i > 120) throw new Error('server did not come up\n' + log);await sleep(250);}}async function stop() {if (browser) { try { await browser.close(); } catch {} browser = null; }if (server) {try { server.kill('SIGTERM'); } catch {}await new Promise(r => { if (server.exitCode !== null || server.signalCode !== null) return r(); server.once('exit', r); setTimeout(r, 3000); });server = null;}}async function main() {// ---- the theme gate helper (no server needed) -----------------------------------------------------------------const helper = (args) => { try { return { code: 0, out: execFileSync('node', [join(APP, 'theme/check-theme.mjs'), ...args], { encoding: 'utf8' }) }; } catch (e) { return { code: e.status, out: String(e.stdout) }; } };const own = helper([APP]);check('check-theme on this app: 0 problems (exit 0)', own.code === 0 && /0 problems/.test(own.out), own.out.slice(-600));const fx = join(SCRATCH, 'gate-check-fixture');rmSync(fx, { recursive: true, force: true });mkdirSync(fx, { recursive: true });writeFileSync(join(fx, 'styles.hl'), ["a { color = '#ff0000' }","'.card' { border = '1px solid ' + colorBorder }","'.box' { background = 'white' }","details { border = '1px solid ' + colorBorder }","'.zone' { border = '2px dashed ' + colorBorder } // functional: a drop zone","'.x' { color = 'var(--color-text, #c3c8cd)' border = '0' }",].join('\n'));const bad = helper([fx]);check('check-theme flags a hard-coded #hex, a decorative border and a named colour (exit 1, 3 problems)', bad.code === 1 && /3 problems/.test(bad.out) && /styles.hl:1: hard-coded colour/.test(bad.out) && /styles.hl:2: decorative border/.test(bad.out) && /styles.hl:3: named colour/.test(bad.out), bad.out);// ---- the server ---------------------------------------------------------------------------------------------------await startServer();const routes = ['/', '/elements', '/components', '/shells', '/docs', '/components/month-view', '/components/date-picker', '/components/range-picker', '/components/pagination', '/components/md-editor', '/components/code-editor', '/components/file-upload', '/components/modal', '/shells/content-first', '/shells/content-first/movie', '/shells/list-first', '/shells/list-first/trip', '/shells/three-pane', '/shells/three-pane/m2', '/search/modal'];const codes = await Promise.all(routes.map(async r => [r, (await fetch(BASE + r)).status]));check(`all ${routes.length} pages answer 200`, codes.every(([, c]) => c === 200), JSON.stringify(codes.filter(([, c]) => c !== 200)));const readme = await fetch(BASE + '/components/modal/README.md');check('a component README is served as Markdown', readme.ok && /markdown/.test(readme.headers.get('content-type')));const doc = await fetch(BASE + '/docs/layouts/list-first.md');check('a layout doc is served as Markdown', doc.ok && /markdown/.test(doc.headers.get('content-type')) && (await doc.text()).includes('# ListFirst'));const sr = await fetch(BASE + '/search?q=Date+Pick', { redirect: 'manual' });check('the header search GET /search?q= redirects to /search/<words>', sr.status === 302 && sr.headers.get('location') === '/search/date-pick', sr.status + ' ' + sr.headers.get('location'));const css = await (await fetch(BASE + '/__hl/app.css')).text();check('the stylesheet carries the theme: tokens, type slots and the html-prefixed component rules', /--color-accent:/.test(css) && /--color-type1:/.test(css) && /--layout-column:/.test(css) && css.includes('html pagination button{border:0;}') && css.includes('html md-editor{border:0'), css.slice(0, 300));check('the theme comes BEFORE the components\' own Style (cascade: theme rules win by the html prefix)', css.indexOf('html pagination button') < css.indexOf('pagination button{'), 'order');check('no style rule dropped at boot', !/style DROPPED/.test(log), log.split('\n').filter(l => /DROPPED/.test(l)).join('\n'));browser = await launchBrowser({ debugPortRange: [CH_FROM, CH_TO] });const page = await browser.newPage();const ev = (e) => page.evaluate(e);const shot = async (name) => { const { data } = await page.send('Page.captureScreenshot', { format: 'png' }); writeFileSync(join(SHOTS, `gate-${name}.png`), Buffer.from(data, 'base64')); };const size = (w) => page.send('Emulation.setDeviceMetricsOverride', { width: w, height: w < 600 ? 844 : 900, deviceScaleFactor: 1, mobile: w < 600 });const open = async (path) => {await page.goto(BASE + path, { timeout: 45000 });await page.waitFor('!!window.__hl && window.__hl.socket && window.__hl.socket.readyState === 1', { timeout: 30000, label: 'hydrated ' + path });await sleep(300);};const shown = (sel) => ev(`(() => { const el = document.querySelector(${JSON.stringify(sel)}); if (!el) return false; const r = el.getBoundingClientRect(); return getComputedStyle(el).display !== 'none' && r.width > 0 && r.height > 0; })()`);const rect = (sel) => ev(`(() => { const el = document.querySelector(${JSON.stringify(sel)}); if (!el) return null; const r = el.getBoundingClientRect(); return { x: Math.round(r.left), r: Math.round(r.right), y: Math.round(r.top), w: Math.round(r.width), h: Math.round(r.height) }; })()`);const noSideways = async (label) => { const o = await ev('({ sw: document.documentElement.scrollWidth, w: window.innerWidth })'); check(`${label}: no sideways scroll`, o.sw <= o.w, JSON.stringify(o)); };const waitPath = (p) => page.waitFor(`location.pathname === ${JSON.stringify(p)}`, { timeout: 15000, label: 'path ' + p });const press = async (key) => {const vk = key === 'Escape' ? 27 : 13;await page.send('Input.dispatchKeyEvent', { type: 'keyDown', key, code: key, windowsVirtualKeyCode: vk });if (key === 'Enter') await page.send('Input.dispatchKeyEvent', { type: 'char', text: '\r' });await page.send('Input.dispatchKeyEvent', { type: 'keyUp', key, code: key, windowsVirtualKeyCode: vk });};const popOpen = (sel) => ev(`document.querySelector(${JSON.stringify(sel)}).matches(':popover-open')`);// ================================== PHONE (390) ==================================await size(390);// content-first (the showcase site itself): content shown, sidebar hidden until the toggleawait open('/elements');check('390 content-first: main shown, sidebar hidden, toggle shown', await shown('content-first > main') && !(await shown('#sidebar')) && await shown('application-header .menu-toggle'));check('390 header: main menu hidden, loupe + user icon shown', !(await shown('application-header main-menu')) && await shown('application-header .search-toggle') && await shown('user-menu .user-toggle'));await noSideways('390 /elements');await shot('390-content-first');await page.click('application-header .menu-toggle');await page.waitFor(`document.querySelector('#sidebar').matches(':popover-open')`, { label: 'sidebar opens' });await sleep(250);const sb = await rect('#sidebar');check('390 toggle opens the sidebar overlay from the left, over the page', sb && sb.x === 0 && sb.w > 250 && sb.w < 390 && sb.h >= 800, JSON.stringify(sb));check('390 the sidebar holds the main menu (the header has no room for it)', await shown('#sidebar main-menu') && (await ev(`document.querySelector('#sidebar main-menu a.current').textContent`)) === 'Elements');await shot('390-sidebar-open');await press('Escape');await page.waitFor(`!document.querySelector('#sidebar').matches(':popover-open')`, { label: 'Esc closes the sidebar' });check('390 Esc closes the sidebar', !(await shown('#sidebar')));await page.click('application-header .menu-toggle');await page.waitFor(`document.querySelector('#sidebar').matches(':popover-open')`, { label: 'sidebar opens again' });await page.click('#sidebar nav a[href="/components/pagination"]');await waitPath('/components/pagination');await page.waitFor(`!!document.querySelector('pagination')`, { label: 'pagination page' });await sleep(300);check('390 a link in the sidebar navigates and the overlay is closed after it', !(await popOpen('#sidebar')) && !(await shown('#sidebar')));// search: the loupe opens the field under the bar, focused; Enter searchesawait open('/');await page.click('application-header .search-toggle');await page.waitFor(`document.querySelector('#app-search').matches(':popover-open')`, { label: 'search opens' });await sleep(200);const sf = await rect('#app-search');check('390 loupe opens the search field full width under the header, focused', sf && sf.x === 0 && sf.w === 390 && sf.y >= 50 && (await ev(`document.activeElement === document.querySelector('#app-search input')`)), JSON.stringify(sf));await shot('390-search-open');await page.type('#app-search input', 'modal');await press('Enter');await waitPath('/search/modal');await page.waitForSelector('ul.pages a[href="/components/modal"]', { timeout: 15000 });check('390 the search lands on /search/modal and finds the Modal page', true);// user menu: the icon opens the dropdown; Esc closes itawait open('/');await page.click('user-menu .user-toggle');await page.waitFor(`document.querySelector('#user-menu').matches(':popover-open')`, { label: 'user menu opens' });await sleep(200);const um = await rect('#user-menu');const items = await ev(`[...document.querySelectorAll('#user-menu a')].map(a => a.textContent)`);check('390 user icon opens the dropdown at the right edge, Settings then Logout last', um && um.r <= 390 && um.r >= 370 && items.join('|') === 'Settings|Logout', JSON.stringify({ um, items }));await shot('390-user-menu');await press('Escape');await page.waitFor(`!document.querySelector('#user-menu').matches(':popover-open')`, { label: 'Esc closes the user menu' });check('390 Esc closes the user menu', true);// list-first: the list first; an item replaces it; back returnsawait open('/shells/list-first');check('390 list-first /: the list shown, the welcome text never', await shown('list-first > aside') && !(await shown('list-first > main')));check('390 list-first: no sidebar toggle (no overlay in this shell)', !(await shown('application-header .menu-toggle')));await noSideways('390 list-first');await shot('390-list-first-list');await page.click('list-first > aside a[href="/shells/list-first/trip"]');await waitPath('/shells/list-first/trip');await page.waitFor(`document.querySelector('list-first').classList.contains('detail')`, { label: 'detail state' });await sleep(300);check('390 list-first item → only the note shows (list gone), with its long title', !(await shown('list-first > aside')) && await shown('list-first > main') && /Helsinki trip/.test(await ev(`document.querySelector('list-first > main h1').textContent`)));check('390 list-first detail: a back link to the list', await shown('list-first a.back'));await noSideways('390 list-first detail (long title)');await shot('390-list-first-detail');await page.click('list-first a.back');await waitPath('/shells/list-first');await page.waitFor(`document.querySelector('list-first').classList.contains('list')`, { label: 'back to the list' });check('390 back → the list again', await shown('list-first > aside'));// three-pane: list first; folders are the overlay; an item shows with its actionsawait open('/shells/three-pane');check('390 three-pane: the message list first, no message, folders hidden', await shown('three-pane > aside') && !(await shown('three-pane > main')) && !(await shown('#sidebar')));await page.click('application-header .menu-toggle');await page.waitFor(`document.querySelector('#sidebar').matches(':popover-open')`, { label: 'folders open' });await sleep(250);check('390 three-pane: the toggle slides the folders in', /Inbox/.test(await ev(`document.querySelector('#sidebar').textContent`)) && await shown('#sidebar'));await shot('390-three-pane-folders');await page.click('#sidebar .sidebar-close');await page.waitFor(`!document.querySelector('#sidebar').matches(':popover-open')`, { label: '× closes the folders' });check('390 three-pane: the × closes the folders', true);await page.click('three-pane > aside a[href="/shells/three-pane/m3"]');await waitPath('/shells/three-pane/m3');await page.waitFor(`document.querySelector('three-pane').classList.contains('detail')`, { label: 'mail detail' });await sleep(300);check('390 three-pane item → the message with its actions, the list gone', !(await shown('three-pane > aside')) && await shown('three-pane > main > menu') && /tracker#32/.test(await ev(`document.querySelector('three-pane > main h1').textContent`)));await noSideways('390 three-pane detail');await page.click('three-pane > main > menu button[value="Archived"]');await page.waitFor(`/Archived/.test(document.querySelector('three-pane > main output').textContent)`, { label: 'action answered' });check('390 three-pane: an action button answers (mock)', true);await shot('390-three-pane-detail');// content-first demo (signed out): the phone-only sidebar holds the main menuawait open('/shells/content-first');check('390 tracker demo: signed out, a login where the user menu would be', await shown('application-header a.button.primary') && !(await ev(`!!document.querySelector('user-menu')`)));await page.click('application-header .menu-toggle');await page.waitFor(`document.querySelector('#sidebar').matches(':popover-open')`, { label: 'tracker sidebar' });await page.click('#sidebar main-menu a[href="/shells/content-first/movie"]');await waitPath('/shells/content-first/movie');await page.waitFor(`document.querySelector('main h1').textContent === 'Movie'`, { label: 'movies' });check('390 tracker demo: Movies from the sidebar menu → only movies, overlay closed', (await ev(`[...document.querySelectorAll('ul.titles .pill')].every(p => p.textContent === 'Movie')`)) && !(await popOpen('#sidebar')));await noSideways('390 tracker demo');await shot('390-tracker-demo');// every other page at 390: no sideways scrollfor (const r of ['/components/month-view', '/components/date-picker', '/components/range-picker', '/components/md-editor', '/components/code-editor', '/components/file-upload', '/components/modal', '/docs']) {await open(r);await noSideways('390 ' + r);}// ================================== DESKTOP (1280) ==================================await size(1280);await open('/elements');check('1280 content-first: sidebar and main side by side, no toggle, no loupe', await shown('#sidebar') && await shown('content-first > main') && !(await shown('application-header .menu-toggle')) && !(await shown('application-header .search-toggle')));const [brand, um2, sideR, mainR, colR] = [await rect('application-header > a.brand'), await rect('user-menu .user-toggle svg'), await rect('#sidebar > nav a'), await rect('content-first > main'), await rect('content-first')];check('1280 header contents flush with the content column (brand text = sidebar text left, user icon right = column right)', Math.abs(brand.x - (sideR.x + 12)) <= 1 && Math.abs(um2.r - mainR.r) <= 1, JSON.stringify({ brand, um2, sideR, mainR, colR }));check('1280 the header shows the main menu with the page marked, and the search field', await shown('application-header main-menu') && (await ev(`document.querySelector('application-header main-menu a.current').textContent`)) === 'Elements' && await shown('#app-search input'));check('1280 the sidebar does not repeat the main menu', !(await shown('#sidebar main-menu')));await shot('1280-content-first');// themed plain elements: borderless except the foldable and the drop zoneconst b = await ev(`(() => { const s = (q, p) => getComputedStyle(document.querySelector(q))[p]; return {button: s('elements-page button.primary', 'borderTopStyle'), input: s('#el-title', 'borderTopStyle'),details: s('elements-page details', 'borderTopStyle'), drop: s('drop-zone', 'borderTopStyle'),td: s('elements-page td', 'borderTopStyle'), h1: s('elements-page h1', 'color'), strong: s('elements-page strong', 'color') }; })()`);check('1280 elements: buttons, fields, table cells have no border; the foldable solid, the drop zone dashed', b.button === 'none' && b.input === 'none' && b.td === 'none' && b.details === 'solid' && b.drop === 'dashed', JSON.stringify(b));check('1280 elements: titles white (text-strong)', b.h1 === 'rgb(245, 250, 255)' && b.strong === 'rgb(245, 250, 255)', JSON.stringify(b));await page.click('elements-page details:nth-of-type(2) summary');check('1280 elements: a foldable opens on its summary', await ev(`document.querySelectorAll('elements-page details')[1].open`));// the accent switcher: a palette colour becomes --color-accent, survives a reload, Reset returns the defaultconst accentOf = () => ev(`getComputedStyle(document.querySelector('application-header main-menu a.current')).color`);const before = await accentOf();await page.click('accent-switcher button[value="purple"]');await sleep(200);check('1280 accent switcher: purple → the marked menu link is purple', (await accentOf()) === 'rgb(197, 134, 192)', await accentOf());await open('/shells');check('1280 accent switcher: the accent stays on the next page (localStorage)', (await accentOf()) === 'rgb(197, 134, 192)', await accentOf());await shot('1280-accent-purple');await page.click('accent-switcher button.reset');await sleep(200);check('1280 accent switcher: Reset → the theme default again', (await accentOf()) === before, `${await accentOf()} vs ${before}`);// themed components: no decorative frames left, functional ones keptawait open('/components/pagination');check('1280 pagination: no frames, the current page is the accent', (await ev(`getComputedStyle(document.querySelector('pagination li.current button')).borderTopStyle`)) === 'none' && (await ev(`getComputedStyle(document.querySelector('pagination li:not(.current) button')).borderTopStyle`)) === 'none');await page.click('pagination li:nth-child(3) button');await page.waitFor(`document.querySelector('pagination li.current button').textContent === '3'`, { label: 'page 3' });check('1280 pagination still works themed (page 3)', true);await open('/components/md-editor');check('1280 md-editor: no outer frame, no line under the toolbar', (await ev(`getComputedStyle(document.querySelector('md-editor')).borderTopStyle`)) === 'none' && (await ev(`getComputedStyle(document.querySelector('md-editor nav')).borderBottomStyle`)) === 'none');await shot('1280-md-editor');await open('/components/code-editor');check('1280 code-editor: no frame, no gutter line', (await ev(`getComputedStyle(document.querySelector('code-editor')).borderTopStyle`)) === 'none' && (await ev(`getComputedStyle(document.querySelector('code-editor code-gutter')).borderRightStyle`)) === 'none');await open('/components/month-view');check('1280 month-view: day cells without grid lines, today still marked', (await ev(`getComputedStyle(document.querySelector('#month-days li')).borderTopStyle`)) === 'none' && (await ev(`document.querySelectorAll('#month-days li.today').length`)) === 1);await shot('1280-month-view');await open('/components/date-picker');await page.click('date-picker input');await page.waitFor(`getComputedStyle(document.querySelector('date-picker picker-popup')).display !== 'none'`, { label: 'date popup' });await sleep(300);check('1280 date-picker: borderless field, the popup a raised surface without frame', (await ev(`getComputedStyle(document.querySelector('date-picker input')).borderTopStyle`)) === 'none' && (await ev(`getComputedStyle(document.querySelector('date-picker month-view')).borderTopStyle`)) === 'none');await shot('1280-date-picker-open');await open('/components/file-upload');check('1280 file-upload: the drop zone keeps its dashed border, the choose button has none', (await ev(`getComputedStyle(document.querySelector('file-upload drop-zone')).borderTopStyle`)) === 'dashed' && (await ev(`getComputedStyle(document.querySelector('file-upload label.choose')).borderTopStyle`)) === 'none');await open('/components/modal');await page.click('#open-confirm');await page.waitFor(`document.querySelector('#confirm').open`, { label: 'modal open' });await sleep(300);check('1280 modal: the window has no frame, no line under the title', (await ev(`getComputedStyle(document.querySelector('#confirm')).borderTopStyle`)) === 'none' && (await ev(`getComputedStyle(document.querySelector('#confirm header')).borderBottomStyle`)) === 'none');await shot('1280-modal-open');await page.click('#confirm footer button[value="delete"]');await page.waitFor(`document.querySelector('#modal-last').textContent === 'confirm: delete'`, { label: 'modal closed' });check('1280 modal still reports how it closed (confirm: delete)', true);// list-first desktop: both; welcome on /; an item opens beside the listawait open('/shells/list-first');const lf = [await rect('list-first > aside'), await rect('list-first > main')];check('1280 list-first /: list and welcome side by side, full width', await shown('list-first > aside') && await shown('list-first > main') && lf[0].x === 0 && lf[1].x === lf[0].r && lf[1].r === 1280 && /Pick a note/.test(await ev(`document.querySelector('list-first > main').textContent`)), JSON.stringify(lf));const hb = await rect('application-header > a.brand');check('1280 list-first: the header spans the page like the shell (brand at the gutter)', hb.x === 16 || hb.x === 24, JSON.stringify(hb));await page.click('list-first > aside a[href="/shells/list-first/groceries"]');await waitPath('/shells/list-first/groceries');await page.waitFor(`document.querySelector('list-first > main h1') && document.querySelector('list-first > main h1').textContent === 'Groceries'`, { label: 'groceries' });await sleep(300);check('1280 list-first item: the note beside the list, the item marked, no back link', await shown('list-first > aside') && (await ev(`document.querySelector('list-first > aside a.selected').getAttribute('href')`)) === '/shells/list-first/groceries' && !(await shown('list-first a.back')));await shot('1280-list-first-detail');// three-pane desktop: all three at the same timeawait open('/shells/three-pane/m2');const tp = [await rect('#sidebar'), await rect('three-pane > aside'), await rect('three-pane > main')];check('1280 three-pane: folders, list and message side by side', tp.every(Boolean) && tp[0].x === 0 && tp[1].x === tp[0].r && tp[2].x === tp[1].r && tp[2].r === 1280 && !(await shown('application-header .menu-toggle')), JSON.stringify(tp));check('1280 three-pane: the actions panel and the opened message', await shown('three-pane > main > menu') && /borderless/.test(await ev(`document.querySelector('three-pane > main h1').textContent`)));await page.click('three-pane > aside a[href="/shells/three-pane/m4"]');await waitPath('/shells/three-pane/m4');await page.waitFor(`/invoice/.test(document.querySelector('three-pane > main h1').textContent)`, { label: 'm4' });check('1280 three-pane: another message opens in place, all three still shown', await shown('#sidebar') && await shown('three-pane > aside'));await shot('1280-three-pane');// content-first demo desktop: the header menu, the column, the loginawait open('/shells/content-first/series');const tb = [await rect('application-header > a.brand'), await rect('content-first > main'), await rect('application-header a.button.primary')];check('1280 tracker demo: header flush with the centred column (brand left = column left, login right = column right)', Math.abs(tb[0].x - tb[1].x) <= 1 && Math.abs(tb[2].r - tb[1].r) <= 1 && tb[1].x > 16, JSON.stringify(tb));check('1280 tracker demo: the phone-only sidebar is gone, the main menu is in the header with Series marked', !(await shown('#sidebar')) && (await ev(`document.querySelector('application-header main-menu a.current').textContent`)) === 'Series');await shot('1280-tracker-demo');// the user menu on desktopawait open('/');await page.click('user-menu .user-toggle');await page.waitFor(`document.querySelector('#user-menu').matches(':popover-open')`, { label: 'user menu desktop' });await sleep(200);const ud = [await rect('#user-menu'), await rect('content-first > main')];check('1280 user menu: the dropdown ends flush with the column, under the header', Math.abs(ud[0].r - ud[1].r) <= 1 && ud[0].y >= 52, JSON.stringify(ud));await shot('1280-user-menu');const problems = page.problems().filter(m => !/favicon|Failed to load resource/.test(m.text));check('no console errors or warnings on any page', problems.length === 0, problems.map(p => p.text).join('\n'));}try {await main();} catch (e) {failures++;console.log('FAIL (aborted) ' + (e && e.stack || e));} finally {await stop();}console.log(`\n${passes} passed, ${failures} failed — screenshots in .scratch/gate-shots/`);process.exit(failures ? 1 : 0);
Branches
Latest commits
- a3e74c8alayouts mission 002 1/3: components re-copied byte-verbatim from components.hybriel 3f93d71 by tools/sync-components.sh (+ --check, components/SOURCE); gate 73/0, check-theme 0mre
- 80ce6ba9report 001 (mission 075)mre
- 5c6e338flayouts.worldapi.org in Hybriel: WorldAPI theme (tokens, borderless elements, themed components.hybriel components), shells (header, main/user menu, sidebar overlay, content-first, list-first, three-pane), showcase, check-theme helper; gate 73/0 (mission 075)mre