mirror of
https://github.com/Matysh/houseplan-card
synced 2026-10-04 13:48:57 +00:00
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:
@@ -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]));
|
||||
|
||||
Reference in New Issue
Block a user