diff --git a/frontend/rabbi_gerzi/cypress/e2e/admin-element.cy.ts b/frontend/rabbi_gerzi/cypress/e2e/admin-element.cy.ts index ab70619..bc4a7ae 100644 --- a/frontend/rabbi_gerzi/cypress/e2e/admin-element.cy.ts +++ b/frontend/rabbi_gerzi/cypress/e2e/admin-element.cy.ts @@ -281,14 +281,12 @@ describe('admin element editing', () => { .should('be.visible') .and('have.attr', 'src') .and('include', '/storage/element-icons/') - cy.get('[data-cy="element-short-pdf-link"]') + cy.get('[data-cy="element-short-pdf-viewer-button"]') .should('be.visible') - .and('have.attr', 'href') - .and('include', '/storage/element-pdfs/short/') - cy.get('[data-cy="element-long-pdf-link"]') + .and('contain.text', 'View Short PDF') + cy.get('[data-cy="element-long-pdf-viewer-button"]') .should('be.visible') - .and('have.attr', 'href') - .and('include', '/storage/element-pdfs/long/') + .and('contain.text', 'View Long PDF') cy.resetDb() }) @@ -341,8 +339,8 @@ describe('admin element editing', () => { cy.contains('header.site-header a', 'View Element').click() cy.get('[data-cy="element-icon"]').should('not.exist') - cy.get('[data-cy="element-short-pdf-link"]').should('not.exist') - cy.get('[data-cy="element-long-pdf-link"]').should('not.exist') + cy.get('[data-cy="element-short-pdf-viewer-button"]').should('not.exist') + cy.get('[data-cy="element-long-pdf-viewer-button"]').should('not.exist') cy.resetDb() }) diff --git a/frontend/rabbi_gerzi/cypress/e2e/media.cy.ts b/frontend/rabbi_gerzi/cypress/e2e/media.cy.ts index 805be28..0233789 100644 --- a/frontend/rabbi_gerzi/cypress/e2e/media.cy.ts +++ b/frontend/rabbi_gerzi/cypress/e2e/media.cy.ts @@ -51,8 +51,8 @@ describe('media page sets', () => { 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-short-pdf-link"]').should('not.exist') - cy.get('[data-cy="element-long-pdf-link"]').should('not.exist') + cy.get('[data-cy="element-short-pdf-viewer-button"]').should('not.exist') + cy.get('[data-cy="element-long-pdf-viewer-button"]').should('not.exist') cy.get('[data-cy="child-element-list"]').should('be.visible') cy.get('[data-cy="child-element-list"]') .should( @@ -117,14 +117,34 @@ describe('media page sets', () => { ) .should('have.css', 'text-align', 'center') cy.get('[data-cy="element-youtube-embed"]').should('not.exist') - cy.contains('[data-cy="element-short-pdf-link"]', 'View Short PDF') - .as('shortPdfLink') + cy.contains( + '[data-cy="element-short-pdf-viewer-button"]', + 'View Short PDF', + ) + .as('shortPdfButton') + .should('be.visible') + cy.get('[data-cy="element-long-pdf-viewer-button"]').should('not.exist') + cy.get('@shortPdfButton').click() + cy.get('[data-cy="pdf-viewer-modal"]').should('be.visible') + cy.contains('[data-cy="pdf-viewer-title"]', 'Short PDF').should( + 'be.visible', + ) + cy.get('[data-cy="pdf-viewer-document"]').should('be.visible') + cy.get('[data-cy="pdf-viewer-page-status"]').should('be.visible') + cy.get('[data-cy="pdf-viewer-previous-page"]').should('be.visible') + cy.get('[data-cy="pdf-viewer-next-page"]').should('be.visible') + cy.get('[data-cy="pdf-viewer-zoom-out"]').should('be.visible') + cy.get('[data-cy="pdf-viewer-zoom-in"]').should('be.visible') + cy.get('[data-cy="pdf-viewer-search-input"]').should('be.visible') + cy.get('[data-cy="pdf-viewer-download"]').should('be.visible') + cy.get('[data-cy="pdf-viewer-print"]').should('be.visible') + cy.get('[data-cy="pdf-viewer-open-link"]') .should('be.visible') .and('have.attr', 'target', '_blank') - cy.get('@shortPdfLink') .and('have.attr', 'href') .and('include', '/storage/element-pdfs/short/baderech.pdf') - cy.get('[data-cy="element-long-pdf-link"]').should('not.exist') + cy.get('[data-cy="pdf-viewer-close"]').click() + cy.get('[data-cy="pdf-viewer-modal"]').should('not.exist') cy.contains('[data-cy="child-element-link"]', introductionAudioTitle) .as('introductionAudioLink') .should('have.attr', 'href', '/element/8') @@ -134,8 +154,8 @@ describe('media page sets', () => { cy.contains('h1', introductionAudioTitle).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-short-pdf-link"]').should('not.exist') - cy.get('[data-cy="element-long-pdf-link"]').should('not.exist') + cy.get('[data-cy="element-short-pdf-viewer-button"]').should('not.exist') + cy.get('[data-cy="element-long-pdf-viewer-button"]').should('not.exist') cy.get('[data-cy="child-element-list"]').should('not.exist') cy.get('[data-cy="element-youtube-embed"]') .should('be.visible')