mirror of https://github.com/apache/superset.git
chore: Moves spec files to the src folder - iteration 10 (#17902)
* chore: Moves spec files to the src folder - iteration 10 * Fixes test * Fixes lint problem * Uses styledMount in test
This commit is contained in:
parent
bb7e979142
commit
647bbf1ea1
|
@ -17,11 +17,16 @@
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { mount, shallow } from 'enzyme';
|
import { shallow } from 'enzyme';
|
||||||
import { supersetTheme, ThemeProvider } from '@superset-ui/core';
|
import { styledMount as mount } from 'spec/helpers/theming';
|
||||||
|
import thunk from 'redux-thunk';
|
||||||
|
import configureStore from 'redux-mock-store';
|
||||||
import { Dropdown, Menu } from 'src/common/components';
|
import { Dropdown, Menu } from 'src/common/components';
|
||||||
import ExploreAdditionalActionsMenu from 'src/explore/components/ExploreAdditionalActionsMenu';
|
import ExploreAdditionalActionsMenu from 'src/explore/components/ExploreAdditionalActionsMenu';
|
||||||
|
|
||||||
|
const mockStore = configureStore([thunk]);
|
||||||
|
const store = mockStore({});
|
||||||
|
|
||||||
describe('ExploreAdditionalActionsMenu', () => {
|
describe('ExploreAdditionalActionsMenu', () => {
|
||||||
const defaultProps = {
|
const defaultProps = {
|
||||||
animation: false,
|
animation: false,
|
||||||
|
@ -43,12 +48,9 @@ describe('ExploreAdditionalActionsMenu', () => {
|
||||||
).toBe(true);
|
).toBe(true);
|
||||||
});
|
});
|
||||||
it('renders a dropdown with 3 items', () => {
|
it('renders a dropdown with 3 items', () => {
|
||||||
const wrapper = mount(<ExploreAdditionalActionsMenu {...defaultProps} />, {
|
const wrapper = mount(
|
||||||
wrappingComponent: ThemeProvider,
|
<ExploreAdditionalActionsMenu store={store} {...defaultProps} />,
|
||||||
wrappingComponentProps: {
|
);
|
||||||
theme: supersetTheme,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
const dropdown = wrapper.find(Dropdown);
|
const dropdown = wrapper.find(Dropdown);
|
||||||
const menu = shallow(<div>{dropdown.prop('overlay')}</div>);
|
const menu = shallow(<div>{dropdown.prop('overlay')}</div>);
|
||||||
const menuItems = menu.find(Menu.Item);
|
const menuItems = menu.find(Menu.Item);
|
|
@ -33,7 +33,7 @@ import {
|
||||||
controlPanelSectionsChartOptions,
|
controlPanelSectionsChartOptions,
|
||||||
controlPanelSectionsChartOptionsOnlyColorScheme,
|
controlPanelSectionsChartOptionsOnlyColorScheme,
|
||||||
controlPanelSectionsChartOptionsTable,
|
controlPanelSectionsChartOptionsTable,
|
||||||
} from 'spec/javascripts/explore/fixtures';
|
} from 'src/explore/fixtures';
|
||||||
|
|
||||||
const getKnownControlConfig = (controlKey: string, vizType: string) =>
|
const getKnownControlConfig = (controlKey: string, vizType: string) =>
|
||||||
getControlConfig(controlKey, vizType) as ControlConfig;
|
getControlConfig(controlKey, vizType) as ControlConfig;
|
Loading…
Reference in New Issue