mirror of
https://github.com/Matysh/houseplan-card
synced 2026-07-31 08:28: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.
39 lines
2.0 KiB
JavaScript
39 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 sr = () => c.shadowRoot || c.renderRoot;
|
||
const setFill = async (settings) => {
|
||
c._serverCfg = { ...c._serverCfg, spaces: c._serverCfg.spaces.map((s) => s.id !== 'f1' ? s : ({ ...s, settings })) };
|
||
c.requestUpdate(); await c.updateComplete;
|
||
return [...sr().querySelectorAll('.room.styled')].map((r) => {
|
||
const st = r.getAttribute('style') || '';
|
||
const m = st.match(/--room-fill:([^;]+)/);
|
||
return m ? m[1] : null;
|
||
});
|
||
};
|
||
// living room avg temp = 22.4 (единственный термометр в demo)
|
||
out.comfy = await setFill({ show_borders: true, fill_mode: 'temp', temp_min: 20, temp_max: 25 });
|
||
out.cold = await setFill({ show_borders: true, fill_mode: 'temp', temp_min: 23, temp_max: 26 });
|
||
out.hot = await setFill({ show_borders: true, fill_mode: 'temp', temp_min: 18, temp_max: 21 });
|
||
out.swapped = await setFill({ show_borders: true, fill_mode: 'temp', temp_min: 25, temp_max: 20 });
|
||
// диалог: поля границ видны только в режиме temp
|
||
c._openSpaceDialog('edit', 'f1'); await c.updateComplete;
|
||
out.dialogTempFields = sr().querySelectorAll('.tempin').length;
|
||
c._spaceDialog = { ...c._spaceDialog, fillMode: 'none' }; await c.updateComplete;
|
||
out.dialogHiddenWhenNone = sr().querySelectorAll('.tempin').length;
|
||
c._spaceDialog = null;
|
||
return out;
|
||
});
|
||
// значения зафиксированы прогоном на v1.43.1 и сверены с кодом (audit T1)
|
||
checkAll(res, {
|
||
"comfy": ["#66d17a", "transparent", "transparent", "transparent"],
|
||
"cold": ["#4fc3f7", "transparent", "transparent", "transparent"],
|
||
"hot": ["#ffd45c", "transparent", "transparent", "transparent"],
|
||
"swapped": ["#66d17a", "transparent", "transparent", "transparent"],
|
||
"dialogTempFields": 3,
|
||
"dialogHiddenWhenNone": 1,
|
||
});
|
||
await finish(browser, res);
|