From 478e767c83282a91e885ba0689acdcd3d87eeab1 Mon Sep 17 00:00:00 2001 From: Frederic Jung Date: Thu, 5 Nov 2026 20:25:23 +0100 Subject: [PATCH] Latency test: no padding is zero however the DOM spells it jsdom 30 reports an unset padding as '0', not '0px', which failed the check for the yellow bars in the jsdom update (#302). --- tests/latency.test.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/latency.test.js b/tests/latency.test.js index 5a4714e..9e7bb58 100644 --- a/tests/latency.test.js +++ b/tests/latency.test.js @@ -57,8 +57,9 @@ test('the slow-city warning box does not restyle the yellow progress bars', () = const { ev, errors } = load(); // .bar.warn is the yellow bar; the latency box once used a plain .warn class and padded every yellow bar const st = JSON.parse(ev(`(()=>{const b=document.createElement('div');b.className='bar warn';const w=document.createElement('div');w.className='latwarn';document.body.append(b,w); - const a=getComputedStyle(b),c=getComputedStyle(w);return JSON.stringify({bar:a.paddingTop+a.paddingLeft,box:c.paddingTop});})()`)); - assert.ok(!st.bar || st.bar === '0px0px', `yellow bars have no padding (${st.bar})`); + const a=getComputedStyle(b),c=getComputedStyle(w);return JSON.stringify({bar:[a.paddingTop,a.paddingLeft],box:c.paddingTop});})()`)); + // No padding reads as '', '0px' or (jsdom 30) '0', depending on the DOM: any of them is zero. + assert.ok(st.bar.every((v) => !v || parseFloat(v) === 0), `yellow bars have no padding (${st.bar})`); assert.equal(st.box, '8px', 'the warning box keeps its own'); assert.deepEqual(errors, []); });