mirror of
https://github.com/Matysh/houseplan-card
synced 2026-07-31 16:38:31 +00:00
T1: demo/serve.mjs exports check/checkAll/finish — all 48 smokes now assert named facts and exit non-zero on a mismatch or an uncaught in-card exception (verified by breaking the kiosk guard on purpose). Informational values were frozen from a v1.43.1 run and cross-read against the source; timings assert budgets, not exact numbers. T2: new CI job 'smoke' gated on 'frontend', builds a FRESH bundle before running (the committed demo/srv/assets copy is a snapshot) and uploads per-file logs on failure. T3: [auto] now means 'a named failing check exists' and each line names it (43 lines); 72 aspirational markers honestly downgraded to [manual]. Fixed the 'ZERO edit buttons' contradiction (wrong since v1.30.1) and the opening-click line (true again since v1.43.1). Three smokes carried pre-v1.39.0/v1.25 expectations and were testing old behaviour: tap defaults for lights, card-wide tap action, label drag requiring plan mode. DEVELOPMENT.md documents the harness contract.
53 lines
3.0 KiB
JavaScript
53 lines
3.0 KiB
JavaScript
import { launch, checkAll, finish } from './serve.mjs';
|
||
const { page, browser } = await launch();
|
||
const res = await page.evaluate(async () => {
|
||
const out = {};
|
||
const c = window.__card;
|
||
const sr = () => c.shadowRoot || c.renderRoot;
|
||
// добавить открывание на f1
|
||
c._serverCfg = { ...c._serverCfg, spaces: c._serverCfg.spaces.map((s) => s.id !== 'f1' ? s : ({
|
||
...s, openings: [{ id: 'op1', type: 'door', rx: 550, ry: 200, angle: 90, len_cm: 90 }] })) };
|
||
c.requestUpdate(); await c.updateComplete;
|
||
const hit = sr().querySelector('.op-hit');
|
||
out.hasOpening = !!hit;
|
||
const cs = hit ? getComputedStyle(hit) : null;
|
||
out.viewInert = cs ? cs.pointerEvents === 'none' && cs.cursor === 'default' : null;
|
||
out.lockBadgeInert = (() => { const l = sr().querySelector('.oplock'); return l ? getComputedStyle(l).pointerEvents === 'none' : 'no-badge'; })();
|
||
// View: клик по открыванию ничего не открывает
|
||
c._opClick({ stopPropagation(){} }, { id: 'op1', rx: 550, ry: 200, rlen: 90 });
|
||
out.viewClickNoop = !c._openingInfo && !c._openingDialog;
|
||
// курсор устройств в Просмотре — pointer, в Устройствах — grab
|
||
const dev = sr().querySelector('.dev');
|
||
out.viewDevCursor = getComputedStyle(dev).cursor;
|
||
// бейдж замка: замок привязан → бейдж кликабелен и открывает инфо
|
||
c._serverCfg = { ...c._serverCfg, spaces: c._serverCfg.spaces.map((s2) => s2.id !== 'f1' ? s2 : ({
|
||
...s2, openings: [{ id: 'op1', type: 'door', rx: 550, ry: 200, angle: 90, len_cm: 90, lock: 'lock.front_door' }] })) };
|
||
c.requestUpdate(); await c.updateComplete;
|
||
const badge = sr().querySelector('.oplock');
|
||
out.badgeShown = !!badge;
|
||
const bcs = badge ? getComputedStyle(badge) : null;
|
||
out.badgeClickableInView = bcs ? bcs.pointerEvents === 'auto' && bcs.cursor === 'pointer' : null;
|
||
badge?.click(); await c.updateComplete;
|
||
out.badgeOpensInfo = !!c._openingInfo;
|
||
c._openingInfo = null;
|
||
// Plan: op-hit интерактивен, клик редактирует
|
||
c._setMode('devices'); await c.updateComplete;
|
||
out.devModeCursor = getComputedStyle(sr().querySelector('.dev')).cursor;
|
||
c._setMode('plan'); await c.updateComplete;
|
||
out.badgeInertInPlan = (() => { const b = sr().querySelector('.oplock'); return b ? getComputedStyle(b).pointerEvents === 'none' : 'no-badge'; })();
|
||
const cs2 = getComputedStyle(sr().querySelector('.op-hit'));
|
||
out.planInteractive = cs2.pointerEvents === 'auto' && cs2.cursor === 'grab';
|
||
const op = c._spaceModel().openings?.[0] || { id: 'op1', rx: 550, ry: 200, rlen: 90 };
|
||
c._opClick({ stopPropagation(){} }, op);
|
||
out.planClickEdits = !!c._openingDialog;
|
||
c._openingDialog = null; c._setMode('view');
|
||
return out;
|
||
});
|
||
// значения зафиксированы прогоном на v1.43.1 и сверены с кодом (audit T1)
|
||
checkAll(res, {
|
||
"lockBadgeInert": "no-badge",
|
||
"viewDevCursor": "pointer",
|
||
"devModeCursor": "grab",
|
||
});
|
||
await finish(browser, res);
|