-
Notifications
You must be signed in to change notification settings - Fork 113
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
Mingze Xiao
committed
Jan 4, 2020
1 parent
0250432
commit f09b826
Showing
2 changed files
with
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// <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', () => { | ||
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.only('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'); | ||
}); | ||
}); |
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