From 48bc71c38af95d527f8ea944108b79c29ae29b8a Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Tue, 3 Nov 2026 23:14:28 +0000 Subject: [PATCH] test(ui): compare the composer height with a sub-pixel tolerance Chromium reported 175.99998 px before focus and 176 px after, so the exact toBe check failed in about half of the runs. Allow half a pixel. Assisted-by: Claude:claude-sonnet-5-5 playwright --- core/http/react-ui/e2e/home-composer.spec.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/http/react-ui/e2e/home-composer.spec.js b/core/http/react-ui/e2e/home-composer.spec.js index 7f1a0009e0..1b33b477cf 100644 --- a/core/http/react-ui/e2e/home-composer.spec.js +++ b/core/http/react-ui/e2e/home-composer.spec.js @@ -69,7 +69,8 @@ test.describe('Home composer', () => { await expect(card).toHaveCSS('box-shadow', /inset/) await expect(box).toHaveCSS('outline-style', 'none') await expect(box).toHaveCSS('box-shadow', 'none') - expect((await card.boundingBox()).height).toBe(before) + // Layout rounds to 1/64 px, so compare with a sub-pixel tolerance. + expect(Math.abs((await card.boundingBox()).height - before)).toBeLessThan(0.5) // the control that takes keyboard focus next keeps its own ring await page.keyboard.press('Shift+Tab') await expect(card.locator(':focus-visible')).toHaveCSS('outline-style', 'solid')