-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DT-776] Filter by Data Type (#2726)
- Loading branch information
Showing
4 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
cypress/component/DataSearch/dataset_search_filters.spec.js
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,27 @@ | ||
/* eslint-disable no-undef */ | ||
|
||
import { mount } from 'cypress/react'; | ||
import React from 'react'; | ||
import {Storage} from '../../../src/libs/storage'; | ||
import DatasetFilterList from '../../../src/components/data_search/DatasetFilterList'; | ||
|
||
const duosUser = { | ||
isSigningOfficial: false, | ||
}; | ||
|
||
describe('Data Library Filters', () => { | ||
// Intercept configuration calls | ||
beforeEach(() => { | ||
cy.intercept({ | ||
method: 'GET', | ||
url: '/config.json', | ||
hostname: 'localhost', | ||
}, { 'env': 'ci' }); | ||
}); | ||
|
||
it('Renders the data library filters', () => { | ||
const props = { datasets: [], filters: [], filterHandler: () => {}, isFiltered: () => {}}; | ||
mount(<DatasetFilterList {...props} />); | ||
cy.get('div').should('contain', 'Filters'); | ||
}); | ||
}); |
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,33 @@ | ||
/* eslint-disable no-undef */ | ||
|
||
import { mount } from 'cypress/react'; | ||
import React from 'react'; | ||
import {Storage} from '../../../src/libs/storage'; | ||
import DatasetSearch from '../../../src/pages/DatasetSearch'; | ||
|
||
const duosUser = { | ||
isSigningOfficial: false, | ||
}; | ||
|
||
describe('Data Library', () => { | ||
// Intercept configuration calls | ||
beforeEach(() => { | ||
cy.intercept({ | ||
method: 'GET', | ||
url: '/config.json', | ||
hostname: 'localhost', | ||
}, { 'env': 'ci' }); | ||
}); | ||
|
||
it('Renders the data library without a query', () => { | ||
const props = { match: { params: { query: undefined } } }; | ||
cy.stub(Storage, 'getCurrentUser').returns(duosUser); | ||
mount(<DatasetSearch {...props} />); | ||
}); | ||
|
||
it('Renders the data library with a query', () => { | ||
const props = { match: { params: { query: 'test' } } }; | ||
cy.stub(Storage, 'getCurrentUser').returns(duosUser); | ||
mount(<DatasetSearch {...props} />); | ||
}); | ||
}); |
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