mirror of
https://github.com/apache/superset.git
synced 2026-05-09 01:46:06 +00:00
chore: Removes direct theme imports (#19368)
This commit is contained in:
committed by
GitHub
parent
d304849b46
commit
816a2c3e1e
@@ -19,7 +19,8 @@
|
||||
import React from 'react';
|
||||
import sinon from 'sinon';
|
||||
import configureStore from 'redux-mock-store';
|
||||
import { shallow } from 'enzyme';
|
||||
import { mount, shallow } from 'enzyme';
|
||||
import { supersetTheme, ThemeProvider } from '@superset-ui/core';
|
||||
import { Menu } from 'src/components/Menu';
|
||||
import {
|
||||
DatasourceModal,
|
||||
@@ -60,8 +61,10 @@ describe('DatasourceControl', () => {
|
||||
...defaultProps,
|
||||
...overrideProps,
|
||||
};
|
||||
return shallow(<DatasourceControl {...props} />, {
|
||||
return mount(<DatasourceControl {...props} />, {
|
||||
context: { store },
|
||||
wrappingComponent: ThemeProvider,
|
||||
wrappingComponentProps: { theme: supersetTheme },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -80,7 +83,7 @@ describe('DatasourceControl', () => {
|
||||
expect(wrapper.find('[data-test="datasource-menu"]')).toExist();
|
||||
let menuWrapper = shallow(
|
||||
<div>
|
||||
{wrapper.find('[data-test="datasource-menu"]').prop('overlay')}
|
||||
{wrapper.find('[data-test="datasource-menu"]').first().prop('overlay')}
|
||||
</div>,
|
||||
);
|
||||
expect(menuWrapper.find(Menu.Item)).toHaveLength(3);
|
||||
@@ -91,7 +94,7 @@ describe('DatasourceControl', () => {
|
||||
expect(wrapper.find('[data-test="datasource-menu"]')).toExist();
|
||||
menuWrapper = shallow(
|
||||
<div>
|
||||
{wrapper.find('[data-test="datasource-menu"]').prop('overlay')}
|
||||
{wrapper.find('[data-test="datasource-menu"]').first().prop('overlay')}
|
||||
</div>,
|
||||
);
|
||||
expect(menuWrapper.find(Menu.Item)).toHaveLength(2);
|
||||
@@ -113,7 +116,7 @@ describe('DatasourceControl', () => {
|
||||
expect(wrapper.find('[data-test="datasource-menu"]')).toExist();
|
||||
menuWrapper = shallow(
|
||||
<div>
|
||||
{wrapper.find('[data-test="datasource-menu"]').prop('overlay')}
|
||||
{wrapper.find('[data-test="datasource-menu"]').first().prop('overlay')}
|
||||
</div>,
|
||||
);
|
||||
expect(menuWrapper.find(Menu.Item)).toHaveLength(2);
|
||||
|
||||
Reference in New Issue
Block a user