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.
38 lines
2.0 KiB
JavaScript
38 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;
|
||
// 1) диалог общих настроек: 7 цветовых строк, 3 группы
|
||
c._openSettingsDialog(); await c.updateComplete;
|
||
out.rows = sr().querySelectorAll('.gsrow').length;
|
||
out.groups = [...sr().querySelectorAll('.dialog .dispsection')].map((l) => l.textContent.trim());
|
||
// 2) сменить цвет light_on и сохранить
|
||
c._setFillColor('light_on', { c: '#ff00ff', a: 0.5 });
|
||
await c._saveSettingsDialog(); await c.updateComplete;
|
||
out.saved = c._serverCfg.settings.fill_colors?.light_on;
|
||
// 3) заливка light использует кастомный цвет
|
||
c._serverCfg = { ...c._serverCfg, spaces: c._serverCfg.spaces.map((s) => s.id !== 'f1' ? s : ({ ...s,
|
||
settings: { ...(s.settings||{}), show_borders: true, fill_mode: 'light' } })) };
|
||
c.requestUpdate(); await c.updateComplete;
|
||
const styles = [...sr().querySelectorAll('.room.styled')].map((r) => r.getAttribute('style') || '');
|
||
out.customFillUsed = styles.some((st) => st.includes('#ff00ff') && st.includes('0.500'));
|
||
// 4) show_lqi=false у пространства скрывает LQI-бейджи
|
||
out.lqiBefore = sr().querySelectorAll('.dev .lqi').length;
|
||
c._serverCfg = { ...c._serverCfg, spaces: c._serverCfg.spaces.map((s) => s.id !== 'f1' ? s : ({ ...s,
|
||
settings: { ...(s.settings||{}), show_lqi: false } })) };
|
||
c.requestUpdate(); await c.updateComplete;
|
||
out.lqiAfter = sr().querySelectorAll('.dev .lqi').length;
|
||
return out;
|
||
});
|
||
// значения зафиксированы прогоном на v1.43.1 и сверены с кодом (audit T1)
|
||
checkAll(res, {
|
||
"rows": 11,
|
||
"groups": ["Fill: lights", "Fill: temperature", "Fill: zigbee signal", "Light-sources fill"],
|
||
"saved": {"c": "#ff00ff", "a": 0.5},
|
||
"lqiBefore": 7,
|
||
"lqiAfter": 0,
|
||
});
|
||
await finish(browser, res);
|