|
| 1 | +const releaseUrl = |
| 2 | + 'https://github.com/archivesspace/archivesspace/releases/latest' |
| 3 | +const title = 'Go to the latest ArchivesSpace release' |
| 4 | +const badgeSrc = `https://img.shields.io/github/v/release/archivesspace/archivesspace?label=ArchivesSpace&color=007595` |
| 5 | +const altText = 'The latest ArchivesSpace release version' |
| 6 | + |
| 7 | +describe('Release Badge', () => { |
| 8 | + it('displays the release badge with the correct data in the header on desktop', () => { |
| 9 | + cy.visit('/') |
| 10 | + cy.get( |
| 11 | + '.page > header:first-child > div:first-child > div:nth-child(3) > a:first-child' |
| 12 | + ) |
| 13 | + .should('have.attr', 'href', releaseUrl) |
| 14 | + .should('have.attr', 'title', title) |
| 15 | + .within(() => { |
| 16 | + cy.get('img') |
| 17 | + .should('have.attr', 'src', badgeSrc) |
| 18 | + .should('have.attr', 'alt', altText) |
| 19 | + }) |
| 20 | + }) |
| 21 | + |
| 22 | + it( |
| 23 | + 'displays the release badge with the correct data in the mobile menu footer', |
| 24 | + { viewportWidth: 400 }, |
| 25 | + () => { |
| 26 | + cy.visit('/') |
| 27 | + cy.get('button[aria-label="Menu"]').click() |
| 28 | + cy.get('#starlight__sidebar .mobile-preferences > a:first-child') |
| 29 | + .should('have.attr', 'href', releaseUrl) |
| 30 | + .should('have.attr', 'title', title) |
| 31 | + .within(() => { |
| 32 | + cy.get('img') |
| 33 | + .should('have.attr', 'src', badgeSrc) |
| 34 | + .should('have.attr', 'alt', altText) |
| 35 | + }) |
| 36 | + } |
| 37 | + ) |
| 38 | +}) |
0 commit comments