From ebb6e7502a4d0861bb1a3c07eba53716eeffbdc1 Mon Sep 17 00:00:00 2001 From: Jeremy Press Date: Tue, 5 Mar 2019 14:44:13 -0800 Subject: [PATCH] Chore: Add test for internal presentation links (#951) --- .../document/PresentationViewer.e2e.test.js | 17 ++++++++++++++++- test/support/constants.js | 3 ++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/test/integration/document/PresentationViewer.e2e.test.js b/test/integration/document/PresentationViewer.e2e.test.js index 438ceae5c..3c7b68533 100644 --- a/test/integration/document/PresentationViewer.e2e.test.js +++ b/test/integration/document/PresentationViewer.e2e.test.js @@ -2,14 +2,16 @@ describe('Presentation Viewer', () => { const token = Cypress.env('ACCESS_TOKEN'); const fileId = Cypress.env('FILE_ID_PRESENTATION'); + const fileWithLinksId = Cypress.env('FILE_ID_PRESENTATION_WITH_LINKS'); beforeEach(() => { cy.visit('/'); - cy.showPreview(token, fileId); }); it('Should initialize preview on the same page it was closed on', () => { + cy.showPreview(token, fileId); + // Assert document content is present cy.contains('For Teaching Economics'); @@ -25,4 +27,17 @@ describe('Presentation Viewer', () => { }); + it('Should navigate to a specified page when an internal link is clicked', () => { + cy.showPreview(token, fileWithLinksId); + + // Assert document content is present and clickable + cy.contains('LINK TO PAGE 3'); + + // Internal links should be rendered with tags by PDF.js + cy.getByTestId('bp-content').find('a').click(); + + cy.getPreviewPage(3).should('be.visible'); + + }); + }); diff --git a/test/support/constants.js b/test/support/constants.js index e21b4fb7c..925068862 100644 --- a/test/support/constants.js +++ b/test/support/constants.js @@ -2,8 +2,9 @@ Cypress.env({ ACCESS_TOKEN: 'S8wjvjOL9GEK5VtXsQNVMOwSrx1g55oC', FILE_ID_DOC: '415542803939', FILE_ID_PRESENTATION: '415537552367', + FILE_ID_PRESENTATION_WITH_LINKS: '416052594867', FILE_ID_MP3: '415542687401', - FILE_ID_VIDEO: '415535384156', + FILE_ID_VIDEO: '416047501580', FILE_ID_VIDEO_SUBTITLES_TRACKS: '415542245854', FILE_ID_VIDEO_SMALL: '415542846356' });