Skip to content

Commit

Permalink
feat(archive): Use testid
Browse files Browse the repository at this point in the history
  • Loading branch information
Mingze Xiao committed Jan 17, 2020
1 parent 3dc1f3c commit 93ebbc9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/lib/viewers/archive/SearchBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const SearchBar = ({ onSearch, searchQuery }) => {
<input
aria-label={__('search')}
data-resin-target="searchInput"
data-testid="search-input"
onChange={({ currentTarget }) => onSearch(currentTarget.value)}
placeholder={__('search_placeholder')}
type="search"
Expand Down
6 changes: 3 additions & 3 deletions test/integration/archive/ArchiveViewer.e2e.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ describe('Archive Viewer', () => {
cy.get('button').click();
});

cy.get('.bp-SearchBar input').type('level');
cy.getByTestId('search-input').type('level');
cy.contains('Level 2 Folder');

cy.get('.bp-SearchBar input').clear();
cy.getByTestId('search-input').clear();
cy.contains('Preview SDK Sample Excel.xlsx');

// fuzzy search
cy.get('.bp-SearchBar input').type('vido');
cy.getByTestId('search-input').type('vido');
cy.contains('Video (Normal).mp4');
});
});

0 comments on commit 93ebbc9

Please sign in to comment.