Skip to content

Commit

Permalink
Chore: Add test for internal presentation links (#951)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Press authored Mar 5, 2019
1 parent bd6b479 commit ebb6e75
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
17 changes: 16 additions & 1 deletion test/integration/document/PresentationViewer.e2e.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand All @@ -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 <a> tags by PDF.js
cy.getByTestId('bp-content').find('a').click();

cy.getPreviewPage(3).should('be.visible');

});

});
3 changes: 2 additions & 1 deletion test/support/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
});

0 comments on commit ebb6e75

Please sign in to comment.