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', 1)
      .first()
      .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')
      })
  })
})
