Skip to content

Commit

Permalink
chore: Moves spec files to the src folder - iteration 10 (#17902)
Browse files Browse the repository at this point in the history
* chore: Moves spec files to the src folder - iteration 10

* Fixes test

* Fixes lint problem

* Uses styledMount in test
  • Loading branch information
michael-s-molina authored Jan 7, 2022
1 parent bb7e979 commit 647bbf1
Show file tree
Hide file tree
Showing 37 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
File renamed without changes.

0 comments on commit 647bbf1

Please sign in to comment.