From aa7d7964fa4a5e9f32448b1e6528d63aed22b9e5 Mon Sep 17 00:00:00 2001 From: "Michael S. Molina" Date: Thu, 30 Dec 2021 11:10:37 -0300 Subject: [PATCH 1/4] chore: Moves spec files to the src folder - iteration 10 --- .../RunQueryActionButton/RunQueryActionButton.test.jsx} | 0 .../explore/actions/exploreActions.test.js} | 0 .../explore/components/ControlPanelsContainer.test.tsx} | 0 .../explore/components/ControlRow.test.tsx} | 0 .../explore/components/EmbedCodeButton.test.jsx} | 0 .../explore/components/ExploreActionButtons.test.jsx} | 0 .../ExploreAdditionalActionsMenu.test.jsx} | 0 .../explore/components/ExploreChartPanel.test.jsx} | 0 .../explore/components/ExploreViewContainer.test.jsx} | 0 .../explore/components/QueryAndSaveBtns.test.jsx} | 0 .../explore/components/RowCountLabel.test.jsx} | 0 .../explore/components/SaveModal.test.jsx} | 0 .../explore/components/controls/BoundsControl.test.jsx} | 0 .../explore/components/controls/CheckboxControl.test.tsx} | 0 .../explore/components/controls/ColorPickerControl.test.tsx} | 0 .../controls/ColorSchemeControl/ColorScheme.test.jsx} | 0 .../controls/DatasourceControl/DatasourceControl.test.jsx} | 0 .../FilterBoxItemControl/FilterBoxItemControl.test.jsx} | 0 .../components/controls/MetricControl/AdhocMetric.test.js} | 0 .../AdhocMetricEditPopover/AdhocMetricEditPopover.test.jsx} | 0 .../MetricControl/AdhocMetricEditPopoverTitle.test.jsx} | 0 .../controls/MetricControl/AdhocMetricOption.test.jsx} | 0 .../components/controls/MetricControl/AggregateOption.test.tsx} | 0 .../controls/MetricControl/FilterDefinitionOption.test.jsx} | 0 .../controls/MetricControl/MetricDefinitionOption.test.jsx} | 0 .../controls/MetricControl/MetricDefinitionValue.test.jsx} | 0 .../components/controls/MetricControl/MetricsControl.test.jsx} | 0 .../explore/components/controls/SelectControl.test.jsx} | 0 .../explore/components/controls/TextAreaControl.test.jsx} | 0 .../explore/components/controls/ViewportControl.test.jsx} | 0 .../components/controls/VizTypeControl/VizTypeControl.test.jsx} | 0 .../explore/components/controls/withAsyncVerification.test.tsx} | 0 .../explore/controlUtils/controlUtils.test.tsx} | 2 +- .../explore/exploreUtils/exploreUtils.test.jsx} | 0 .../{spec/javascripts => src}/explore/fixtures.tsx | 0 .../explore/store_spec.jsx => src/explore/store.test.jsx} | 0 .../visualizations/FilterBox/FilterBox.test.jsx} | 0 37 files changed, 1 insertion(+), 1 deletion(-) rename superset-frontend/{spec/javascripts/explore/components/RunQueryActionButton_spec.jsx => src/SqlLab/components/RunQueryActionButton/RunQueryActionButton.test.jsx} (100%) rename superset-frontend/{spec/javascripts/explore/exploreActions_spec.js => src/explore/actions/exploreActions.test.js} (100%) rename superset-frontend/{spec/javascripts/explore/components/ControlPanelsContainer_spec.tsx => src/explore/components/ControlPanelsContainer.test.tsx} (100%) rename superset-frontend/{spec/javascripts/explore/components/ControlRow_spec.tsx => src/explore/components/ControlRow.test.tsx} (100%) rename superset-frontend/{spec/javascripts/explore/components/EmbedCodeButton_spec.jsx => src/explore/components/EmbedCodeButton.test.jsx} (100%) rename superset-frontend/{spec/javascripts/explore/components/ExploreActionButtons_spec.jsx => src/explore/components/ExploreActionButtons.test.jsx} (100%) rename superset-frontend/{spec/javascripts/explore/components/ExploreAdditionalActionsMenu.jsx => src/explore/components/ExploreAdditionalActionsMenu/ExploreAdditionalActionsMenu.test.jsx} (100%) rename superset-frontend/{spec/javascripts/explore/components/ExploreChartPanel_spec.jsx => src/explore/components/ExploreChartPanel.test.jsx} (100%) rename superset-frontend/{spec/javascripts/explore/components/ExploreViewContainer_spec.jsx => src/explore/components/ExploreViewContainer.test.jsx} (100%) rename superset-frontend/{spec/javascripts/explore/components/QueryAndSaveBtns_spec.jsx => src/explore/components/QueryAndSaveBtns.test.jsx} (100%) rename superset-frontend/{spec/javascripts/explore/components/RowCountLabel_spec.jsx => src/explore/components/RowCountLabel.test.jsx} (100%) rename superset-frontend/{spec/javascripts/explore/components/SaveModal_spec.jsx => src/explore/components/SaveModal.test.jsx} (100%) rename superset-frontend/{spec/javascripts/explore/components/BoundsControl_spec.jsx => src/explore/components/controls/BoundsControl.test.jsx} (100%) rename superset-frontend/{spec/javascripts/explore/components/CheckboxControl_spec.tsx => src/explore/components/controls/CheckboxControl.test.tsx} (100%) rename superset-frontend/{spec/javascripts/explore/components/ColorPickerControl_spec.tsx => src/explore/components/controls/ColorPickerControl.test.tsx} (100%) rename superset-frontend/{spec/javascripts/explore/components/ColorScheme_spec.jsx => src/explore/components/controls/ColorSchemeControl/ColorScheme.test.jsx} (100%) rename superset-frontend/{spec/javascripts/explore/components/DatasourceControl_spec.jsx => src/explore/components/controls/DatasourceControl/DatasourceControl.test.jsx} (100%) rename superset-frontend/{spec/javascripts/explore/components/FilterBoxItemControl_spec.jsx => src/explore/components/controls/FilterBoxItemControl/FilterBoxItemControl.test.jsx} (100%) rename superset-frontend/{spec/javascripts/explore/AdhocMetric_spec.js => src/explore/components/controls/MetricControl/AdhocMetric.test.js} (100%) rename superset-frontend/{spec/javascripts/explore/components/AdhocMetricEditPopover_spec.jsx => src/explore/components/controls/MetricControl/AdhocMetricEditPopover/AdhocMetricEditPopover.test.jsx} (100%) rename superset-frontend/{spec/javascripts/explore/components/AdhocMetricEditPopoverTitle_spec.jsx => src/explore/components/controls/MetricControl/AdhocMetricEditPopoverTitle.test.jsx} (100%) rename superset-frontend/{spec/javascripts/explore/components/AdhocMetricOption_spec.jsx => src/explore/components/controls/MetricControl/AdhocMetricOption.test.jsx} (100%) rename superset-frontend/{spec/javascripts/explore/components/AggregateOption_spec.tsx => src/explore/components/controls/MetricControl/AggregateOption.test.tsx} (100%) rename superset-frontend/{spec/javascripts/explore/components/FilterDefinitionOption_spec.jsx => src/explore/components/controls/MetricControl/FilterDefinitionOption.test.jsx} (100%) rename superset-frontend/{spec/javascripts/explore/components/MetricDefinitionOption_spec.jsx => src/explore/components/controls/MetricControl/MetricDefinitionOption.test.jsx} (100%) rename superset-frontend/{spec/javascripts/explore/components/MetricDefinitionValue_spec.jsx => src/explore/components/controls/MetricControl/MetricDefinitionValue.test.jsx} (100%) rename superset-frontend/{spec/javascripts/explore/components/MetricsControl_spec.jsx => src/explore/components/controls/MetricControl/MetricsControl.test.jsx} (100%) rename superset-frontend/{spec/javascripts/explore/components/SelectControl_spec.jsx => src/explore/components/controls/SelectControl.test.jsx} (100%) rename superset-frontend/{spec/javascripts/explore/components/TextArea_spec.jsx => src/explore/components/controls/TextAreaControl.test.jsx} (100%) rename superset-frontend/{spec/javascripts/explore/components/ViewportControl_spec.jsx => src/explore/components/controls/ViewportControl.test.jsx} (100%) rename superset-frontend/{spec/javascripts/explore/components/VizTypeControl_spec.jsx => src/explore/components/controls/VizTypeControl/VizTypeControl.test.jsx} (100%) rename superset-frontend/{spec/javascripts/explore/components/withAsyncVerification_spec.tsx => src/explore/components/controls/withAsyncVerification.test.tsx} (100%) rename superset-frontend/{spec/javascripts/explore/controlUtils_spec.tsx => src/explore/controlUtils/controlUtils.test.tsx} (99%) rename superset-frontend/{spec/javascripts/explore/utils_spec.jsx => src/explore/exploreUtils/exploreUtils.test.jsx} (100%) rename superset-frontend/{spec/javascripts => src}/explore/fixtures.tsx (100%) rename superset-frontend/{spec/javascripts/explore/store_spec.jsx => src/explore/store.test.jsx} (100%) rename superset-frontend/{spec/javascripts/explore/components/FilterBox_spec.jsx => src/visualizations/FilterBox/FilterBox.test.jsx} (100%) diff --git a/superset-frontend/spec/javascripts/explore/components/RunQueryActionButton_spec.jsx b/superset-frontend/src/SqlLab/components/RunQueryActionButton/RunQueryActionButton.test.jsx similarity index 100% rename from superset-frontend/spec/javascripts/explore/components/RunQueryActionButton_spec.jsx rename to superset-frontend/src/SqlLab/components/RunQueryActionButton/RunQueryActionButton.test.jsx diff --git a/superset-frontend/spec/javascripts/explore/exploreActions_spec.js b/superset-frontend/src/explore/actions/exploreActions.test.js similarity index 100% rename from superset-frontend/spec/javascripts/explore/exploreActions_spec.js rename to superset-frontend/src/explore/actions/exploreActions.test.js diff --git a/superset-frontend/spec/javascripts/explore/components/ControlPanelsContainer_spec.tsx b/superset-frontend/src/explore/components/ControlPanelsContainer.test.tsx similarity index 100% rename from superset-frontend/spec/javascripts/explore/components/ControlPanelsContainer_spec.tsx rename to superset-frontend/src/explore/components/ControlPanelsContainer.test.tsx diff --git a/superset-frontend/spec/javascripts/explore/components/ControlRow_spec.tsx b/superset-frontend/src/explore/components/ControlRow.test.tsx similarity index 100% rename from superset-frontend/spec/javascripts/explore/components/ControlRow_spec.tsx rename to superset-frontend/src/explore/components/ControlRow.test.tsx diff --git a/superset-frontend/spec/javascripts/explore/components/EmbedCodeButton_spec.jsx b/superset-frontend/src/explore/components/EmbedCodeButton.test.jsx similarity index 100% rename from superset-frontend/spec/javascripts/explore/components/EmbedCodeButton_spec.jsx rename to superset-frontend/src/explore/components/EmbedCodeButton.test.jsx diff --git a/superset-frontend/spec/javascripts/explore/components/ExploreActionButtons_spec.jsx b/superset-frontend/src/explore/components/ExploreActionButtons.test.jsx similarity index 100% rename from superset-frontend/spec/javascripts/explore/components/ExploreActionButtons_spec.jsx rename to superset-frontend/src/explore/components/ExploreActionButtons.test.jsx diff --git a/superset-frontend/spec/javascripts/explore/components/ExploreAdditionalActionsMenu.jsx b/superset-frontend/src/explore/components/ExploreAdditionalActionsMenu/ExploreAdditionalActionsMenu.test.jsx similarity index 100% rename from superset-frontend/spec/javascripts/explore/components/ExploreAdditionalActionsMenu.jsx rename to superset-frontend/src/explore/components/ExploreAdditionalActionsMenu/ExploreAdditionalActionsMenu.test.jsx diff --git a/superset-frontend/spec/javascripts/explore/components/ExploreChartPanel_spec.jsx b/superset-frontend/src/explore/components/ExploreChartPanel.test.jsx similarity index 100% rename from superset-frontend/spec/javascripts/explore/components/ExploreChartPanel_spec.jsx rename to superset-frontend/src/explore/components/ExploreChartPanel.test.jsx diff --git a/superset-frontend/spec/javascripts/explore/components/ExploreViewContainer_spec.jsx b/superset-frontend/src/explore/components/ExploreViewContainer.test.jsx similarity index 100% rename from superset-frontend/spec/javascripts/explore/components/ExploreViewContainer_spec.jsx rename to superset-frontend/src/explore/components/ExploreViewContainer.test.jsx diff --git a/superset-frontend/spec/javascripts/explore/components/QueryAndSaveBtns_spec.jsx b/superset-frontend/src/explore/components/QueryAndSaveBtns.test.jsx similarity index 100% rename from superset-frontend/spec/javascripts/explore/components/QueryAndSaveBtns_spec.jsx rename to superset-frontend/src/explore/components/QueryAndSaveBtns.test.jsx diff --git a/superset-frontend/spec/javascripts/explore/components/RowCountLabel_spec.jsx b/superset-frontend/src/explore/components/RowCountLabel.test.jsx similarity index 100% rename from superset-frontend/spec/javascripts/explore/components/RowCountLabel_spec.jsx rename to superset-frontend/src/explore/components/RowCountLabel.test.jsx diff --git a/superset-frontend/spec/javascripts/explore/components/SaveModal_spec.jsx b/superset-frontend/src/explore/components/SaveModal.test.jsx similarity index 100% rename from superset-frontend/spec/javascripts/explore/components/SaveModal_spec.jsx rename to superset-frontend/src/explore/components/SaveModal.test.jsx diff --git a/superset-frontend/spec/javascripts/explore/components/BoundsControl_spec.jsx b/superset-frontend/src/explore/components/controls/BoundsControl.test.jsx similarity index 100% rename from superset-frontend/spec/javascripts/explore/components/BoundsControl_spec.jsx rename to superset-frontend/src/explore/components/controls/BoundsControl.test.jsx diff --git a/superset-frontend/spec/javascripts/explore/components/CheckboxControl_spec.tsx b/superset-frontend/src/explore/components/controls/CheckboxControl.test.tsx similarity index 100% rename from superset-frontend/spec/javascripts/explore/components/CheckboxControl_spec.tsx rename to superset-frontend/src/explore/components/controls/CheckboxControl.test.tsx diff --git a/superset-frontend/spec/javascripts/explore/components/ColorPickerControl_spec.tsx b/superset-frontend/src/explore/components/controls/ColorPickerControl.test.tsx similarity index 100% rename from superset-frontend/spec/javascripts/explore/components/ColorPickerControl_spec.tsx rename to superset-frontend/src/explore/components/controls/ColorPickerControl.test.tsx diff --git a/superset-frontend/spec/javascripts/explore/components/ColorScheme_spec.jsx b/superset-frontend/src/explore/components/controls/ColorSchemeControl/ColorScheme.test.jsx similarity index 100% rename from superset-frontend/spec/javascripts/explore/components/ColorScheme_spec.jsx rename to superset-frontend/src/explore/components/controls/ColorSchemeControl/ColorScheme.test.jsx diff --git a/superset-frontend/spec/javascripts/explore/components/DatasourceControl_spec.jsx b/superset-frontend/src/explore/components/controls/DatasourceControl/DatasourceControl.test.jsx similarity index 100% rename from superset-frontend/spec/javascripts/explore/components/DatasourceControl_spec.jsx rename to superset-frontend/src/explore/components/controls/DatasourceControl/DatasourceControl.test.jsx diff --git a/superset-frontend/spec/javascripts/explore/components/FilterBoxItemControl_spec.jsx b/superset-frontend/src/explore/components/controls/FilterBoxItemControl/FilterBoxItemControl.test.jsx similarity index 100% rename from superset-frontend/spec/javascripts/explore/components/FilterBoxItemControl_spec.jsx rename to superset-frontend/src/explore/components/controls/FilterBoxItemControl/FilterBoxItemControl.test.jsx diff --git a/superset-frontend/spec/javascripts/explore/AdhocMetric_spec.js b/superset-frontend/src/explore/components/controls/MetricControl/AdhocMetric.test.js similarity index 100% rename from superset-frontend/spec/javascripts/explore/AdhocMetric_spec.js rename to superset-frontend/src/explore/components/controls/MetricControl/AdhocMetric.test.js diff --git a/superset-frontend/spec/javascripts/explore/components/AdhocMetricEditPopover_spec.jsx b/superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricEditPopover/AdhocMetricEditPopover.test.jsx similarity index 100% rename from superset-frontend/spec/javascripts/explore/components/AdhocMetricEditPopover_spec.jsx rename to superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricEditPopover/AdhocMetricEditPopover.test.jsx diff --git a/superset-frontend/spec/javascripts/explore/components/AdhocMetricEditPopoverTitle_spec.jsx b/superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricEditPopoverTitle.test.jsx similarity index 100% rename from superset-frontend/spec/javascripts/explore/components/AdhocMetricEditPopoverTitle_spec.jsx rename to superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricEditPopoverTitle.test.jsx diff --git a/superset-frontend/spec/javascripts/explore/components/AdhocMetricOption_spec.jsx b/superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricOption.test.jsx similarity index 100% rename from superset-frontend/spec/javascripts/explore/components/AdhocMetricOption_spec.jsx rename to superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricOption.test.jsx diff --git a/superset-frontend/spec/javascripts/explore/components/AggregateOption_spec.tsx b/superset-frontend/src/explore/components/controls/MetricControl/AggregateOption.test.tsx similarity index 100% rename from superset-frontend/spec/javascripts/explore/components/AggregateOption_spec.tsx rename to superset-frontend/src/explore/components/controls/MetricControl/AggregateOption.test.tsx diff --git a/superset-frontend/spec/javascripts/explore/components/FilterDefinitionOption_spec.jsx b/superset-frontend/src/explore/components/controls/MetricControl/FilterDefinitionOption.test.jsx similarity index 100% rename from superset-frontend/spec/javascripts/explore/components/FilterDefinitionOption_spec.jsx rename to superset-frontend/src/explore/components/controls/MetricControl/FilterDefinitionOption.test.jsx diff --git a/superset-frontend/spec/javascripts/explore/components/MetricDefinitionOption_spec.jsx b/superset-frontend/src/explore/components/controls/MetricControl/MetricDefinitionOption.test.jsx similarity index 100% rename from superset-frontend/spec/javascripts/explore/components/MetricDefinitionOption_spec.jsx rename to superset-frontend/src/explore/components/controls/MetricControl/MetricDefinitionOption.test.jsx diff --git a/superset-frontend/spec/javascripts/explore/components/MetricDefinitionValue_spec.jsx b/superset-frontend/src/explore/components/controls/MetricControl/MetricDefinitionValue.test.jsx similarity index 100% rename from superset-frontend/spec/javascripts/explore/components/MetricDefinitionValue_spec.jsx rename to superset-frontend/src/explore/components/controls/MetricControl/MetricDefinitionValue.test.jsx diff --git a/superset-frontend/spec/javascripts/explore/components/MetricsControl_spec.jsx b/superset-frontend/src/explore/components/controls/MetricControl/MetricsControl.test.jsx similarity index 100% rename from superset-frontend/spec/javascripts/explore/components/MetricsControl_spec.jsx rename to superset-frontend/src/explore/components/controls/MetricControl/MetricsControl.test.jsx diff --git a/superset-frontend/spec/javascripts/explore/components/SelectControl_spec.jsx b/superset-frontend/src/explore/components/controls/SelectControl.test.jsx similarity index 100% rename from superset-frontend/spec/javascripts/explore/components/SelectControl_spec.jsx rename to superset-frontend/src/explore/components/controls/SelectControl.test.jsx diff --git a/superset-frontend/spec/javascripts/explore/components/TextArea_spec.jsx b/superset-frontend/src/explore/components/controls/TextAreaControl.test.jsx similarity index 100% rename from superset-frontend/spec/javascripts/explore/components/TextArea_spec.jsx rename to superset-frontend/src/explore/components/controls/TextAreaControl.test.jsx diff --git a/superset-frontend/spec/javascripts/explore/components/ViewportControl_spec.jsx b/superset-frontend/src/explore/components/controls/ViewportControl.test.jsx similarity index 100% rename from superset-frontend/spec/javascripts/explore/components/ViewportControl_spec.jsx rename to superset-frontend/src/explore/components/controls/ViewportControl.test.jsx diff --git a/superset-frontend/spec/javascripts/explore/components/VizTypeControl_spec.jsx b/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeControl.test.jsx similarity index 100% rename from superset-frontend/spec/javascripts/explore/components/VizTypeControl_spec.jsx rename to superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeControl.test.jsx diff --git a/superset-frontend/spec/javascripts/explore/components/withAsyncVerification_spec.tsx b/superset-frontend/src/explore/components/controls/withAsyncVerification.test.tsx similarity index 100% rename from superset-frontend/spec/javascripts/explore/components/withAsyncVerification_spec.tsx rename to superset-frontend/src/explore/components/controls/withAsyncVerification.test.tsx diff --git a/superset-frontend/spec/javascripts/explore/controlUtils_spec.tsx b/superset-frontend/src/explore/controlUtils/controlUtils.test.tsx similarity index 99% rename from superset-frontend/spec/javascripts/explore/controlUtils_spec.tsx rename to superset-frontend/src/explore/controlUtils/controlUtils.test.tsx index db3e9717b8a32..ac8dcef7a517e 100644 --- a/superset-frontend/spec/javascripts/explore/controlUtils_spec.tsx +++ b/superset-frontend/src/explore/controlUtils/controlUtils.test.tsx @@ -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; diff --git a/superset-frontend/spec/javascripts/explore/utils_spec.jsx b/superset-frontend/src/explore/exploreUtils/exploreUtils.test.jsx similarity index 100% rename from superset-frontend/spec/javascripts/explore/utils_spec.jsx rename to superset-frontend/src/explore/exploreUtils/exploreUtils.test.jsx diff --git a/superset-frontend/spec/javascripts/explore/fixtures.tsx b/superset-frontend/src/explore/fixtures.tsx similarity index 100% rename from superset-frontend/spec/javascripts/explore/fixtures.tsx rename to superset-frontend/src/explore/fixtures.tsx diff --git a/superset-frontend/spec/javascripts/explore/store_spec.jsx b/superset-frontend/src/explore/store.test.jsx similarity index 100% rename from superset-frontend/spec/javascripts/explore/store_spec.jsx rename to superset-frontend/src/explore/store.test.jsx diff --git a/superset-frontend/spec/javascripts/explore/components/FilterBox_spec.jsx b/superset-frontend/src/visualizations/FilterBox/FilterBox.test.jsx similarity index 100% rename from superset-frontend/spec/javascripts/explore/components/FilterBox_spec.jsx rename to superset-frontend/src/visualizations/FilterBox/FilterBox.test.jsx From c32705b351bd930877c9441a0767e525bf499da7 Mon Sep 17 00:00:00 2001 From: "Michael S. Molina" Date: Thu, 30 Dec 2021 13:26:38 -0300 Subject: [PATCH 2/4] Fixes test --- .../ExploreAdditionalActionsMenu.test.jsx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/superset-frontend/src/explore/components/ExploreAdditionalActionsMenu/ExploreAdditionalActionsMenu.test.jsx b/superset-frontend/src/explore/components/ExploreAdditionalActionsMenu/ExploreAdditionalActionsMenu.test.jsx index 09380586c3c3f..67da89730e4d8 100644 --- a/superset-frontend/src/explore/components/ExploreAdditionalActionsMenu/ExploreAdditionalActionsMenu.test.jsx +++ b/superset-frontend/src/explore/components/ExploreAdditionalActionsMenu/ExploreAdditionalActionsMenu.test.jsx @@ -18,9 +18,13 @@ */ import React from 'react'; import { mount, shallow } from 'enzyme'; +import thunk from 'redux-thunk'; +import configureStore from 'redux-mock-store'; import { supersetTheme, ThemeProvider } from '@superset-ui/core'; 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 = { @@ -43,12 +47,15 @@ describe('ExploreAdditionalActionsMenu', () => { ).toBe(true); }); it('renders a dropdown with 3 items', () => { - const wrapper = mount(, { - wrappingComponent: ThemeProvider, - wrappingComponentProps: { - theme: supersetTheme, + const wrapper = mount( + , + { + wrappingComponent: ThemeProvider, + wrappingComponentProps: { + theme: supersetTheme, + }, }, - }); + ); const dropdown = wrapper.find(Dropdown); const menu = shallow(
{dropdown.prop('overlay')}
); const menuItems = menu.find(Menu.Item); From b2738cb9824f9ba5f09835369af4323f0e0b00a5 Mon Sep 17 00:00:00 2001 From: "Michael S. Molina" Date: Thu, 30 Dec 2021 13:41:03 -0300 Subject: [PATCH 3/4] Fixes lint problem --- .../ExploreAdditionalActionsMenu.test.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/superset-frontend/src/explore/components/ExploreAdditionalActionsMenu/ExploreAdditionalActionsMenu.test.jsx b/superset-frontend/src/explore/components/ExploreAdditionalActionsMenu/ExploreAdditionalActionsMenu.test.jsx index 67da89730e4d8..a7d1e5191ac02 100644 --- a/superset-frontend/src/explore/components/ExploreAdditionalActionsMenu/ExploreAdditionalActionsMenu.test.jsx +++ b/superset-frontend/src/explore/components/ExploreAdditionalActionsMenu/ExploreAdditionalActionsMenu.test.jsx @@ -23,6 +23,7 @@ import configureStore from 'redux-mock-store'; import { supersetTheme, ThemeProvider } from '@superset-ui/core'; import { Dropdown, Menu } from 'src/common/components'; import ExploreAdditionalActionsMenu from 'src/explore/components/ExploreAdditionalActionsMenu'; + const mockStore = configureStore([thunk]); const store = mockStore({}); From 1e86d2e7899fe98a6f4d3a0556f094924fc3f88e Mon Sep 17 00:00:00 2001 From: "Michael S. Molina" Date: Fri, 7 Jan 2022 09:30:22 -0300 Subject: [PATCH 4/4] Uses styledMount in test --- .../ExploreAdditionalActionsMenu.test.jsx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/superset-frontend/src/explore/components/ExploreAdditionalActionsMenu/ExploreAdditionalActionsMenu.test.jsx b/superset-frontend/src/explore/components/ExploreAdditionalActionsMenu/ExploreAdditionalActionsMenu.test.jsx index a7d1e5191ac02..b40a8a8e8f5fe 100644 --- a/superset-frontend/src/explore/components/ExploreAdditionalActionsMenu/ExploreAdditionalActionsMenu.test.jsx +++ b/superset-frontend/src/explore/components/ExploreAdditionalActionsMenu/ExploreAdditionalActionsMenu.test.jsx @@ -17,10 +17,10 @@ * under the License. */ import React from 'react'; -import { mount, shallow } from 'enzyme'; +import { shallow } from 'enzyme'; +import { styledMount as mount } from 'spec/helpers/theming'; import thunk from 'redux-thunk'; import configureStore from 'redux-mock-store'; -import { supersetTheme, ThemeProvider } from '@superset-ui/core'; import { Dropdown, Menu } from 'src/common/components'; import ExploreAdditionalActionsMenu from 'src/explore/components/ExploreAdditionalActionsMenu'; @@ -50,12 +50,6 @@ describe('ExploreAdditionalActionsMenu', () => { it('renders a dropdown with 3 items', () => { const wrapper = mount( , - { - wrappingComponent: ThemeProvider, - wrappingComponentProps: { - theme: supersetTheme, - }, - }, ); const dropdown = wrapper.find(Dropdown); const menu = shallow(
{dropdown.prop('overlay')}
);