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, []); });