diff --git a/tests/Browser/ErrorPagesTest.php b/tests/Browser/ErrorPagesTest.php index 2e964900..186a19b8 100644 --- a/tests/Browser/ErrorPagesTest.php +++ b/tests/Browser/ErrorPagesTest.php @@ -136,7 +136,9 @@ it('draws the layout from its own inlined rules under a build that never imports // The layout: a centred column, the art at its 240px from medium, not a shape filling the window. ->assertScript("getComputedStyle(document.querySelector('[data-md-error-page]')).display === 'flex'") ->assertScript("Math.round(document.querySelector('[data-md-error-art]').getBoundingClientRect().width) === 240") - ->assertScript("document.querySelector('[data-md-error-shape] svg').getBoundingClientRect().width <= 240") + // The shape's laid-out width, not its bounding rect: the shape turns once a minute, and a + // rotated box's axis-aligned rect is wider than the box as soon as the turn has begun. + ->assertScript("parseFloat(getComputedStyle(document.querySelector('[data-md-error-shape] svg')).width) <= 240") ->assertScript("(() => { const r = document.querySelector('[data-md-error-headline]').getBoundingClientRect(); return Math.abs((r.left + r.right) / 2 - window.innerWidth / 2) <= 2; })()") // The button and shape rules the layout imports, and the scheme from the application's build. ->assertScript("getComputedStyle(document.querySelector('[data-md-button]')).borderRadius !== '0px'")