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.
36 lines
2.0 KiB
JavaScript
36 lines
2.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 esc = async () => { window.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape' })); await c.updateComplete; };
|
|
// общие настройки
|
|
c._openSettingsDialog(); await c.updateComplete;
|
|
await esc(); out.settings = !c._settingsDialog;
|
|
// правила иконок
|
|
c._openRulesDialog(); await c.updateComplete;
|
|
await esc(); out.rules = !c._rulesDialog;
|
|
// диалог устройства
|
|
c._setMode('devices'); c._openMarkerDialog(); await c.updateComplete;
|
|
await esc(); out.marker = !c._markerDialog;
|
|
// диалог пространства (+ очистка очереди импорта)
|
|
c._openSpaceDialog('edit', c._space); c._importQueue = ['x']; c._importTotal = 1; await c.updateComplete;
|
|
await esc(); out.space = !c._spaceDialog && c._importQueue.length === 0;
|
|
// инфо-карточка устройства
|
|
c._setMode('view'); c._infoCard = c._devices[0]; await c.updateComplete;
|
|
await esc(); out.info = !c._infoCard;
|
|
// инфо двери/замка
|
|
c._openingInfo = { id: 'op1', type: 'door', rx: 550, ry: 200, len_cm: 90, lock: 'lock.front_door' }; await c.updateComplete;
|
|
await esc(); out.openingInfo = !c._openingInfo;
|
|
// приоритет: инфо поверх настроек — Esc закрывает только инфо
|
|
c._openSettingsDialog(); c._infoCard = c._devices[0]; await c.updateComplete;
|
|
await esc(); out.stacked = !c._infoCard && !!c._settingsDialog;
|
|
await esc(); out.stacked2 = !c._settingsDialog;
|
|
// Esc в разметке по-прежнему откатывает точку, а не только диалоги
|
|
c._setMode('plan'); c._tool = 'draw'; c._path = [[1, 2], [3, 4]]; await c.updateComplete;
|
|
await esc(); out.undoPointStillWorks = c._path.length === 1;
|
|
return out;
|
|
});
|
|
checkAll(res);
|
|
await finish(browser, res);
|