From 9df524e2c72ea8828fd4d42c518ba87a57c7a79f Mon Sep 17 00:00:00 2001 From: Lukas Harbarth Date: Fri, 4 Sep 2026 14:32:36 +0200 Subject: [PATCH] test(compat): make Loader background-size assertions Chrome-version tolerant --- packages/compat/src/components/Loader/Loader.cy.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/compat/src/components/Loader/Loader.cy.tsx b/packages/compat/src/components/Loader/Loader.cy.tsx index 8136b372d14..83486764036 100644 --- a/packages/compat/src/components/Loader/Loader.cy.tsx +++ b/packages/compat/src/components/Loader/Loader.cy.tsx @@ -14,13 +14,18 @@ describe('Loader', () => { cy.mount(); cy.findByTestId('loader') .should('have.css', 'animation-duration', '0s') - .should('have.css', 'background-size', '0px'); + // Chrome may serialize the computed value with an explicit `auto` height (e.g. `0px auto`) + .should(($el) => { + expect($el.css('background-size')).to.match(/^0px( auto)?$/); + }); cy.mount(); cy.findByTestId('loader') .should('have.css', 'animation-duration', '0s') - .should('have.css', 'background-size', '50%'); + .should(($el) => { + expect($el.css('background-size')).to.match(/^50%( auto)?$/); + }); }); it('with delay', () => { cy.mount();