test(led): wait for the no-Glow fade to finish (#784)

The state and room-setting updates are separate renders. Assert the stable no-Glow contract after the legitimate 500 ms leaving phase instead of racing it on fast CI runners.

Release: v1.79.0-beta.4

Issue: #784
User-Visible: no
This commit is contained in:
Matysh
2026-10-03 11:15:38 +03:00
parent 654cb9d404
commit 3048ac9195
+5
View File
@@ -184,6 +184,11 @@ check('unavailable: dashed, no field', JSON.stringify([unavailable?.state, !!una
await setState('light.ceiling', 'on', { rgb_color: [128, 213, 255] });
await setStrips(await evaluate(() => window.__card._serverCfg.spaces[0].led_strips), { glow_enabled: false });
await settle();
// The state update and the room setting update are deliberately separate. On
// a fast runner the first render can start the entering transition before the
// second one turns Glow off, so let that legitimate 500 ms leaving phase
// finish before asserting the stable no-Glow contract.
await page.waitForFunction(() => !window.__card.shadowRoot.querySelector('[data-led-field]'));
const colored = await stripe('d_light1');
check('on without Glow: coloured core, no field', JSON.stringify([colored?.state, colored?.core !== '#FFFFFF', await field()]),
JSON.stringify(['on', true, 0]));