diff --git a/test/integration/archive/ArchiveViewer.e2e.test.js b/test/integration/archive/ArchiveViewer.e2e.test.js new file mode 100644 index 0000000000..4346f73521 --- /dev/null +++ b/test/integration/archive/ArchiveViewer.e2e.test.js @@ -0,0 +1,42 @@ +// +describe.skip('Archive Viewer', () => { + const token = Cypress.env('ACCESS_TOKEN'); + const fileId = Cypress.env('FILE_ID_ARCHIVE'); + + beforeEach(() => { + cy.visit('/'); + cy.showPreview(token, fileId); + }); + + it('Should render correct item list', () => { + cy.contains('Preview SDK Sample Excel.xlsx'); + // clicking folder + cy.contains('Level 1 Folder').click(); + cy.contains('XSS.txt'); + cy.contains('Level 2 Folder').click(); + cy.contains('Video (Normal).mp4'); + // clicking breadcrumb + cy.contains('Preview SDK Sample Archive').click(); + cy.contains('JS-Small.js'); + }); + + it('Should sort items when column header is clicked', () => { + cy.getByTitle('Filename').click(); + + cy.get('.ReactVirtualized__Table__row') + .first() + .contains('Audio.mp3'); + }); + + it('Should show matched item list based on search query', () => { + cy.get('.bp-SearchBar input').type('level'); + cy.contains('Level 2 Folder'); + + cy.get('.bp-SearchBar input').clear(); + cy.contains('Preview SDK Sample Excel.xlsx'); + + // fuzzy search + cy.get('.bp-SearchBar input').type('vido'); + cy.contains('Video (Normal).mp4'); + }); +}); diff --git a/test/support/constants.js b/test/support/constants.js index bf8ff716bd..9e1d414362 100644 --- a/test/support/constants.js +++ b/test/support/constants.js @@ -1,6 +1,7 @@ Cypress.env({ // NOTE: The token used is a readonly token accessing public data in a demo enterprise. ACCESS_TOKEN: 'S8wjvjOL9GEK5VtXsQNVMOwSrx1g55oC', + FILE_ID_ARCHIVE: '589625563707', FILE_ID_BAD: '433514141824', FILE_ID_DOC_LARGE: '420985736453', FILE_ID_DOC: '415542803939', @@ -16,5 +17,5 @@ Cypress.env({ FILE_ID_TXT: '420870357452', FILE_ID_VIDEO_SMALL: '415542846356', FILE_ID_VIDEO_SUBTITLES_TRACKS: '415542245854', - FILE_ID_VIDEO: '416047501580' + FILE_ID_VIDEO: '416047501580', });