-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a23deeb
commit 6fd3ce3
Showing
3 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// <reference types="Cypress" /> | ||
describe('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', () => { | ||
// clicking folder | ||
cy.getByTitle('Preview SDK Sample Archive').within(() => { | ||
cy.get('button').click(); | ||
}); | ||
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('Level 1 Folder').click(); | ||
cy.contains('XSS.txt'); | ||
}); | ||
|
||
it('Should sort items when column header is clicked', () => { | ||
cy.getByTitle('Preview SDK Sample Archive').within(() => { | ||
cy.get('button').click(); | ||
}); | ||
|
||
cy.getByTitle('Name').click(); | ||
|
||
cy.get('.ReactVirtualized__Table__row') | ||
.first() | ||
.contains('Audio.mp3'); | ||
}); | ||
|
||
it('Should show matched item list based on search query', () => { | ||
cy.getByTitle('Preview SDK Sample Archive').within(() => { | ||
cy.get('button').click(); | ||
}); | ||
|
||
cy.getByTestId('search-input').type('level'); | ||
cy.contains('Level 2 Folder'); | ||
|
||
cy.getByTestId('search-input').clear(); | ||
cy.contains('Preview SDK Sample Excel.xlsx'); | ||
|
||
// fuzzy search | ||
cy.getByTestId('search-input').type('vido'); | ||
cy.contains('Video (Normal).mp4'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters