From 5e2d1a362b1ebc2a3821b1a1e237ae6211bc2278 Mon Sep 17 00:00:00 2001 From: Yisroel Baum Date: Sat, 6 Jun 2026 21:39:43 +0300 Subject: [PATCH] test portrait background --- frontend/rabbi_gerzi/cypress/e2e/home.cy.ts | 26 +++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/frontend/rabbi_gerzi/cypress/e2e/home.cy.ts b/frontend/rabbi_gerzi/cypress/e2e/home.cy.ts index 3fd34ee..2e9e197 100644 --- a/frontend/rabbi_gerzi/cypress/e2e/home.cy.ts +++ b/frontend/rabbi_gerzi/cypress/e2e/home.cy.ts @@ -63,6 +63,32 @@ describe('homepage hero', () => { }, ) }) + + it('extends the circular background to the portrait base edges', () => { + cy.get('[data-cy="hero-portrait"]').then( + (portraitElements) => { + const portraitImage = portraitElements[0] + const frameElement = portraitImage.parentElement + + if (frameElement === null) { + throw new Error('Portrait frame is missing') + } + + const portraitBounds = portraitImage.getBoundingClientRect() + const frameBounds = frameElement.getBoundingClientRect() + const backgroundStyle = getComputedStyle(frameElement, '::before') + const backgroundWidth = Number.parseFloat(backgroundStyle.width) + const backgroundLeft = + frameBounds.left + (frameBounds.width - backgroundWidth) / 2 + const backgroundRight = backgroundLeft + backgroundWidth + + expect(backgroundStyle.content).to.not.equal('none') + expect(backgroundWidth).to.be.closeTo(portraitBounds.width, 1) + expect(backgroundLeft).to.be.closeTo(portraitBounds.left, 1) + expect(backgroundRight).to.be.closeTo(portraitBounds.right, 1) + }, + ) + }) }) describe('homepage discover path section', () => {