-
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.
feat: add unit tests for data library base page
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
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,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('User Profile', () => { | ||
// 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} />); | ||
}); | ||
}); |