mirror of
https://github.com/apache/superset.git
synced 2026-04-09 19:35:21 +00:00
test(frontend): use absolute path for src imports (#9761)
* test(frontend): use absolute path for src imports * Upgrade prettier, fix eslint
This commit is contained in:
@@ -21,9 +21,9 @@ import sinon from 'sinon';
|
||||
import configureStore from 'redux-mock-store';
|
||||
import { shallow } from 'enzyme';
|
||||
import { MenuItem } from 'react-bootstrap';
|
||||
import DatasourceModal from '../../../../src/datasource/DatasourceModal';
|
||||
import ChangeDatasourceModal from '../../../../src/datasource/ChangeDatasourceModal';
|
||||
import DatasourceControl from '../../../../src/explore/components/controls/DatasourceControl';
|
||||
import DatasourceModal from 'src/datasource/DatasourceModal';
|
||||
import ChangeDatasourceModal from 'src/datasource/ChangeDatasourceModal';
|
||||
import DatasourceControl from 'src/explore/components/controls/DatasourceControl';
|
||||
|
||||
const defaultProps = {
|
||||
name: 'datasource',
|
||||
@@ -70,22 +70,16 @@ describe('DatasourceControl', () => {
|
||||
it('show or hide Edit Datasource option', () => {
|
||||
let wrapper = setup();
|
||||
expect(wrapper.find('#datasource_menu')).toHaveLength(1);
|
||||
expect(
|
||||
wrapper
|
||||
.find('#datasource_menu')
|
||||
.dive()
|
||||
.find(MenuItem),
|
||||
).toHaveLength(2);
|
||||
expect(wrapper.find('#datasource_menu').dive().find(MenuItem)).toHaveLength(
|
||||
2,
|
||||
);
|
||||
|
||||
wrapper = setup({
|
||||
onDatasourceSave: () => {},
|
||||
});
|
||||
expect(wrapper.find('#datasource_menu')).toHaveLength(1);
|
||||
expect(
|
||||
wrapper
|
||||
.find('#datasource_menu')
|
||||
.dive()
|
||||
.find(MenuItem),
|
||||
).toHaveLength(3);
|
||||
expect(wrapper.find('#datasource_menu').dive().find(MenuItem)).toHaveLength(
|
||||
3,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user