99 lines
3.8 KiB
TypeScript
99 lines
3.8 KiB
TypeScript
describe('media page sets', () => {
|
|
it('fetches and renders seeded set cards', () => {
|
|
cy.visit('/media')
|
|
|
|
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('Donate').should('be.visible')
|
|
})
|
|
cy.contains('h1', 'Torah Media').should('be.visible')
|
|
cy.get('[data-cy="media-set-grid"]').should('be.visible')
|
|
cy.get('[data-cy="media-set-card"]', { timeout: 10000 })
|
|
.should('have.length', 2)
|
|
|
|
cy.contains('[data-cy="media-set-card"]', 'Baderech HaAvodah')
|
|
.as('baderechCard')
|
|
.should('have.attr', 'href', '/element/1')
|
|
.within(() => {
|
|
cy.get('img[data-cy="media-set-icon"]')
|
|
.should('be.visible')
|
|
.and('have.attr', 'src')
|
|
.and('include', '/assets/baderech-haavodah-icon.png')
|
|
cy.contains('h2', 'Baderech HaAvodah').should('be.visible')
|
|
cy.contains('a structured path for inner and outer growth')
|
|
.should('be.visible')
|
|
})
|
|
|
|
cy.contains('[data-cy="media-set-card"]', 'Daily Learning')
|
|
.as('dailyLearningCard')
|
|
.should('match', 'article')
|
|
.and('not.have.attr', 'href')
|
|
|
|
cy.get('@dailyLearningCard')
|
|
.within(() => {
|
|
cy.contains('h2', 'Daily Learning').should('be.visible')
|
|
cy.contains('Daily learning for steady growth').should('be.visible')
|
|
})
|
|
|
|
cy.get('@baderechCard').click()
|
|
cy.location('pathname').should('eq', '/element/1')
|
|
cy.get('[data-cy="element-page"]').should('be.visible')
|
|
cy.contains('h1', 'Baderech HaAvodah').should('be.visible')
|
|
cy.get('[data-cy="element-icon"]')
|
|
.should('be.visible')
|
|
.and('have.attr', 'src')
|
|
.and('include', '/assets/baderech-haavodah-icon.png')
|
|
cy.get('[data-cy="element-rich-text"]').should('not.exist')
|
|
cy.get('[data-cy="element-youtube-embed"]')
|
|
.should('not.exist')
|
|
cy.get('[data-cy="element-pdf-link"]').should('not.exist')
|
|
cy.get('[data-cy="child-element-list"]').should('be.visible')
|
|
cy.get('[data-cy="child-element-list"]')
|
|
.should(
|
|
'not.contain.text',
|
|
'Begin with a clear map for avodah growth.',
|
|
)
|
|
cy.contains('[data-cy="child-element-link"]', '1. Introduction')
|
|
.as('introductionLink')
|
|
.should('have.attr', 'href', '/element/2')
|
|
cy.get('@introductionLink')
|
|
.should(
|
|
'contain.text',
|
|
'Your beliefs influence your thinking, and your thinking drives',
|
|
)
|
|
cy.contains('[data-cy="child-element-link"]', '2. Foundations')
|
|
.should(
|
|
'contain.text',
|
|
'Focal points for thriving in a chaotic world.',
|
|
)
|
|
cy.contains('[data-cy="child-element-link"]', '3. Divine Plan')
|
|
.should(
|
|
'contain.text',
|
|
'Understanding the unique greatness of our generation',
|
|
)
|
|
cy.contains(
|
|
'[data-cy="child-element-link"]',
|
|
'4. Architecture of the Soul',
|
|
)
|
|
.should(
|
|
'contain.text',
|
|
"Becoming a Baal Da'at - A Master of Inner Awareness",
|
|
)
|
|
cy.contains('[data-cy="child-element-link"]', '5. Arba Yesodot')
|
|
.should('contain.text', 'Physical & Financial Health')
|
|
cy.contains('[data-cy="child-element-link"]', '6. Fluid Integration')
|
|
.should('contain.text', 'engender a shift in mindset')
|
|
.and('have.attr', 'href', '/element/7')
|
|
|
|
cy.contains('[data-cy="child-element-link"]', '1. Introduction')
|
|
.click()
|
|
cy.location('pathname').should('eq', '/element/2')
|
|
cy.contains('h1', '1. Introduction').should('be.visible')
|
|
cy.get('[data-cy="element-icon"]').should('not.exist')
|
|
cy.get('[data-cy="element-rich-text"]').should('not.exist')
|
|
cy.get('[data-cy="element-youtube-embed"]').should('not.exist')
|
|
cy.get('[data-cy="element-pdf-link"]').should('not.exist')
|
|
})
|
|
})
|