Rabbi_Gerzi/frontend/rabbi_gerzi/cypress/e2e/about.cy.ts

129 lines
4.6 KiB
TypeScript

describe('about page', () => {
beforeEach(() => {
cy.visit('/about')
})
it('renders the header and about hero', () => {
cy.get('header.site-header').within(() => {
cy.contains('Torah Media').should('be.visible')
cy.contains('About').should('be.visible')
cy.contains('Contact').should('be.visible')
cy.contains('Invest in Pilzno').should('be.visible')
})
cy.get('[data-cy="about-hero"]').within(() => {
cy.contains('h1', 'About Rabbi Gerzi').should('be.visible')
cy.contains('Integrated Torah life')
.should('be.visible')
cy.get('[data-cy="about-hero-image"]')
.should('be.visible')
.and('have.attr', 'alt')
.and('match', /Rabbi Yehoshua Gerzi/i)
})
})
it('renders the copied biography and mission sections', () => {
cy.get('[data-cy="about-story"]').within(() => {
cy.contains('h2', 'About Rabbi Gerzi').should('be.visible')
cy.contains('Pilzno Rebbe').should('be.visible')
cy.contains('descends from an illustrious lineage')
.should('be.visible')
cy.contains('physical therapist, music instructor, martial artist')
.should('be.visible')
})
cy.get('[data-cy="about-vision"]').within(() => {
cy.contains('h2', "Rabbi Gerzi's Vision").should('be.visible')
cy.contains('from vagueness to clarity').should('be.visible')
cy.contains('weekly chaburot and various events')
.should('be.visible')
})
cy.get('[data-cy="about-mission"]').within(() => {
cy.contains('h2', 'The Mission').should('be.visible')
cy.contains('A Clear Framework').should('be.visible')
cy.contains('Community and Support').should('be.visible')
cy.contains('Professional Structure').should('be.visible')
})
cy.get('[data-cy="about-teachers"]').within(() => {
cy.contains('h2', "Rabbi Gerzi's Teachers").should('be.visible')
cy.contains('Rabbi Yosef Singer').should('be.visible')
cy.contains('Rabbi Efraim Greenblatt').should('be.visible')
cy.contains('Rabbi Mordechai Zukerman').should('be.visible')
})
})
it('renders the rabbanim section without repeated carousel copies', () => {
const expectedRabbanim = [
'The Biala Rebbe',
'The Pilzno Rebbe, Rabbi Yosef Singer',
'Dayan Gershon Lopian',
'Rabbi Efraim Greenblatt',
'The Sassover Rebbe',
'The Pashkana Rebbe',
'Rabbi Mordechai Zukerman',
'The Radamishler Rebbe',
'Rabbi Yoseph Leiberman',
'The Krechnover Rebbe',
]
cy.get('[data-cy="rabbanim"]').within(() => {
cy.contains('h2', 'Rabbanim').should('be.visible')
cy.get('[data-cy="rabbanim-card"]').should(
'have.length',
expectedRabbanim.length,
)
expectedRabbanim.forEach((rabbiName) => {
cy.contains('[data-cy="rabbanim-card"]', rabbiName)
.should('be.visible')
})
cy.contains('match the person in front of you').should('be.visible')
cy.contains('depth and the profundity of love')
.should('be.visible')
})
})
it('renders the haskamot image gallery', () => {
cy.get('[data-cy="haskamot"]').within(() => {
cy.contains('h2', 'Haskamot').should('be.visible')
cy.get('[data-cy="haskamah-image"]').should('have.length', 6)
cy.get('[data-cy="haskamah-image"]')
.first()
.should('be.visible')
.and('have.attr', 'alt', 'Haskamah letter 1')
cy.get('[data-cy="haskamah-image"]')
.last()
.and('have.attr', 'alt', 'Haskamah letter 6')
})
})
it('keeps the page readable on mobile', () => {
cy.viewport(390, 900)
cy.get('[data-cy="about-hero"]').should('be.visible')
cy.get('[data-cy="rabbanim-card"]').first().should('be.visible')
cy.get('[data-cy="haskamah-image"]').first().should('be.visible')
})
it('renders the get involved form and footer', () => {
cy.get('[data-cy="get-involved"]').within(() => {
cy.contains('h2', 'Get Involved').should('be.visible')
cy.contains('Subscribe for updates as we release new content')
.should('be.visible')
cy.get('input[name="fullName"]').should('be.visible')
cy.get('input[name="email"]').should('be.visible')
cy.contains('button', 'Submit').should('be.visible')
})
cy.get('[data-cy="footer"]').within(() => {
cy.contains('Torah Media').should('be.visible')
cy.contains('About').should('be.visible')
cy.contains('Invest in Pilzno').should('be.visible')
cy.contains('Contact').should('be.visible')
cy.contains(/Rabbi Gerzi 2025/).should('be.visible')
})
})
})