describe('homepage hero', () => { beforeEach(() => { cy.visit('/') }) it('renders the header navigation', () => { cy.get('header').within(() => { cy.contains('Torah Media').should('be.visible') cy.contains('About').should('be.visible') cy.contains('Contact').should('be.visible') cy.contains('Donate').should('be.visible') }) }) it('renders the hero headline with italic emphasis', () => { cy.get('[data-cy="hero"]').within(() => { cy.contains('upgrade our lives').should('be.visible') cy.contains('em', 'healthy').should('be.visible') cy.contains('em', 'integrated').should('be.visible') cy.contains('em', 'balanced').should('be.visible') cy.contains('Torah existence').should('be.visible') cy.contains('Rabbi Yehoshua Gerzi').should('be.visible') }) }) it('renders the rabbi portrait image', () => { cy.get('[data-cy="hero-portrait"]') .should('be.visible') .and('have.attr', 'alt') .and('match', /Rabbi Yehoshua Gerzi/i) }) }) describe('homepage discover path section', () => { beforeEach(() => { cy.visit('/') }) it('renders the heading and body copy', () => { cy.get('[data-cy="discover-path"]').within(() => { cy.contains('h2', 'Discover a Path to a Holistically Engaged Life') .should('be.visible') cy.contains('Rabbi Yehoshua Gerzi has dedicated his life') .should('be.visible') cy.contains('Healthy, Integrated and Balanced Torah Living') .should('be.visible') cy.contains('Ramat Beit Shemesh').should('be.visible') cy.contains('Pilzno Institute of Higher Learning').should('be.visible') }) }) }) describe('homepage core teachings grid', () => { beforeEach(() => { cy.visit('/') }) it('renders the heading and six teaching tiles', () => { cy.get('[data-cy="core-teachings"]').within(() => { cy.contains('h2', 'Baderech HaAvodah').should('be.visible') cy.contains('Core Teachings').should('be.visible') cy.contains('1) Introduction').should('be.visible') cy.contains('2) Foundations').should('be.visible') cy.contains('3) Divine Plan').should('be.visible') cy.contains('4) Architecture of the Soul').should('be.visible') cy.contains('5) Arba Yesodot').should('be.visible') cy.contains('6) Fluid Integration').should('be.visible') }) }) }) describe('homepage unique voice section', () => { beforeEach(() => { cy.visit('/') }) it('renders heading body and cta button', () => { cy.get('[data-cy="unique-voice"]').within(() => { cy.contains('h2', 'A Unique Voice for the Generation') .should('be.visible') cy.contains('wholly unique and much needed perspective') .should('be.visible') cy.contains('practically engaged positivity').should('be.visible') cy.contains('button', /Learn about Rabbi Gerzi.s Approach/) .should('be.visible') }) }) }) describe('homepage testimonials carousel', () => { beforeEach(() => { cy.visit('/') }) it('renders the heading and the active testimonial', () => { cy.get('[data-cy="testimonials"]').within(() => { cy.contains('h2', 'What People Are Saying').should('be.visible') cy.get('[data-cy="testimonial-active"]').within(() => { cy.contains('Nathaniel M').should('be.visible') cy.contains('best Jewish day schools').should('be.visible') }) }) }) it('advances to the next testimonial when next is clicked', () => { cy.get('[data-cy="testimonials"]').within(() => { cy.get('[data-cy="testimonial-active"]') .should('contain.text', 'Nathaniel M') cy.get('[data-cy="testimonial-next"]').click() cy.get('[data-cy="testimonial-active"]') .should('not.contain.text', 'Nathaniel M') }) }) it('goes back to the previous testimonial when prev is clicked', () => { cy.get('[data-cy="testimonials"]').within(() => { cy.get('[data-cy="testimonial-next"]').click() cy.get('[data-cy="testimonial-prev"]').click() cy.get('[data-cy="testimonial-active"]') .should('contain.text', 'Nathaniel M') }) }) }) describe('homepage sponsor strip', () => { beforeEach(() => { cy.visit('/') }) it('renders the heading and all seven partner logos', () => { cy.get('[data-cy="sponsors"]').within(() => { cy.contains('h2', 'Organizations Rabbi Gerzi has Worked With') .should('be.visible') cy.get('[data-cy="sponsor-logo"]').should('have.length', 7) const expectedAlts = [ 'SHARE', 'U of Israel', 'Mayberg Foundation', 'JLE UK', 'Yeshivat Reishit', 'Aish HaTorah', 'Yeshivat Lev HaTorah', ] expectedAlts.forEach((altText) => { cy.get(`[data-cy="sponsor-logo"][alt="${altText}"]`) .should('be.visible') }) }) }) })