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:
Michael S. Molina 2022-01-07 15:24:15 -03:00 committed by GitHub
parent bb7e979142
commit 647bbf1ea1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
37 changed files with 11 additions and 9 deletions

View File

@ -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);

View File

@ -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;