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.
|
||||
*/
|
||||
import React from 'react';
|
||||
import { mount, shallow } from 'enzyme';
|
||||
import { supersetTheme, ThemeProvider } from '@superset-ui/core';
|
||||
import { shallow } from 'enzyme';
|
||||
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 ExploreAdditionalActionsMenu from 'src/explore/components/ExploreAdditionalActionsMenu';
|
||||
|
||||
const mockStore = configureStore([thunk]);
|
||||
const store = mockStore({});
|
||||
|
||||
describe('ExploreAdditionalActionsMenu', () => {
|
||||
const defaultProps = {
|
||||
animation: false,
|
||||
|
@ -43,12 +48,9 @@ describe('ExploreAdditionalActionsMenu', () => {
|
|||
).toBe(true);
|
||||
});
|
||||
it('renders a dropdown with 3 items', () => {
|
||||
const wrapper = mount(<ExploreAdditionalActionsMenu {...defaultProps} />, {
|
||||
wrappingComponent: ThemeProvider,
|
||||
wrappingComponentProps: {
|
||||
theme: supersetTheme,
|
||||
},
|
||||
});
|
||||
const wrapper = mount(
|
||||
<ExploreAdditionalActionsMenu store={store} {...defaultProps} />,
|
||||
);
|
||||
const dropdown = wrapper.find(Dropdown);
|
||||
const menu = shallow(<div>{dropdown.prop('overlay')}</div>);
|
||||
const menuItems = menu.find(Menu.Item);
|
|
@ -33,7 +33,7 @@ import {
|
|||
controlPanelSectionsChartOptions,
|
||||
controlPanelSectionsChartOptionsOnlyColorScheme,
|
||||
controlPanelSectionsChartOptionsTable,
|
||||
} from 'spec/javascripts/explore/fixtures';
|
||||
} from 'src/explore/fixtures';
|
||||
|
||||
const getKnownControlConfig = (controlKey: string, vizType: string) =>
|
||||
getControlConfig(controlKey, vizType) as ControlConfig;
|
Loading…
Reference in New Issue