This is an automated email from the ASF dual-hosted git repository.

tai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new d95b7c2  fix: clean up prop type errors in jest tests (#11120)
d95b7c2 is described below

commit d95b7c2a73ecd0bf0f44434d80ab8496d9cb6311
Author: Elizabeth Thompson <[email protected]>
AuthorDate: Fri Oct 2 14:59:04 2020 -0700

    fix: clean up prop type errors in jest tests (#11120)
---
 .../spec/javascripts/chart/ChartRenderer_spec.jsx  | 15 +++++++++++++--
 .../components/URLShortLinkModal_spec.jsx          |  1 +
 .../dashboard/components/DashboardBuilder_spec.jsx |  1 +
 .../components/FilterIndicatorGroup_spec.jsx       |  7 +++++++
 .../dashboard/components/FilterIndicator_spec.jsx  |  5 +++++
 .../components/HeaderActionsDropdown_spec.jsx      | 22 ++++++++++++++--------
 .../components/AdhocMetricEditPopover_spec.jsx     |  1 +
 .../explore/components/DisplayQueryButton_spec.jsx |  1 +
 .../components/ExploreActionButtons_spec.jsx       |  1 +
 .../explore/components/ExploreChartPanel_spec.jsx  |  6 ++++++
 .../explore/components/QueryAndSaveBtns_spec.jsx   |  2 +-
 .../spec/javascripts/sqllab/QuerySearch_spec.jsx   |  1 +
 12 files changed, 52 insertions(+), 11 deletions(-)

diff --git a/superset-frontend/spec/javascripts/chart/ChartRenderer_spec.jsx 
b/superset-frontend/spec/javascripts/chart/ChartRenderer_spec.jsx
index 51fe073..609b54b 100644
--- a/superset-frontend/spec/javascripts/chart/ChartRenderer_spec.jsx
+++ b/superset-frontend/spec/javascripts/chart/ChartRenderer_spec.jsx
@@ -22,14 +22,25 @@ import { SuperChart } from '@superset-ui/core';
 
 import ChartRenderer from 'src/chart/ChartRenderer';
 
+const requiredProps = {
+  chartId: 1,
+  datasource: {},
+  formData: {},
+  vizType: 'foo',
+};
+
 describe('ChartRenderer', () => {
   it('should render SuperChart', () => {
-    const wrapper = shallow(<ChartRenderer refreshOverlayVisible={false} />);
+    const wrapper = shallow(
+      <ChartRenderer {...requiredProps} refreshOverlayVisible={false} />,
+    );
     expect(wrapper.find(SuperChart)).toExist();
   });
 
   it('should not render SuperChart when refreshOverlayVisible is true', () => {
-    const wrapper = shallow(<ChartRenderer refreshOverlayVisible />);
+    const wrapper = shallow(
+      <ChartRenderer {...requiredProps} refreshOverlayVisible />,
+    );
     expect(wrapper.find(SuperChart)).not.toExist();
   });
 });
diff --git 
a/superset-frontend/spec/javascripts/components/URLShortLinkModal_spec.jsx 
b/superset-frontend/spec/javascripts/components/URLShortLinkModal_spec.jsx
index 163b321..2b68784 100644
--- a/superset-frontend/spec/javascripts/components/URLShortLinkModal_spec.jsx
+++ b/superset-frontend/spec/javascripts/components/URLShortLinkModal_spec.jsx
@@ -28,6 +28,7 @@ describe('URLShortLinkModal', () => {
     url: 'mockURL',
     emailSubject: 'Mock Subject',
     emailContent: 'mock content',
+    triggerNode: <div />,
   };
 
   function setup() {
diff --git 
a/superset-frontend/spec/javascripts/dashboard/components/DashboardBuilder_spec.jsx
 
b/superset-frontend/spec/javascripts/dashboard/components/DashboardBuilder_spec.jsx
index 82211c4..98ad189 100644
--- 
a/superset-frontend/spec/javascripts/dashboard/components/DashboardBuilder_spec.jsx
+++ 
b/superset-frontend/spec/javascripts/dashboard/components/DashboardBuilder_spec.jsx
@@ -67,6 +67,7 @@ describe('DashboardBuilder', () => {
     colorScheme: undefined,
     handleComponentDrop() {},
     setDirectPathToChild: sinon.spy(),
+    setMountedTab() {},
   };
 
   function setup(overrideProps, useProvider = false, store = mockStore) {
diff --git 
a/superset-frontend/spec/javascripts/dashboard/components/FilterIndicatorGroup_spec.jsx
 
b/superset-frontend/spec/javascripts/dashboard/components/FilterIndicatorGroup_spec.jsx
index bf78d23..58ead02 100644
--- 
a/superset-frontend/spec/javascripts/dashboard/components/FilterIndicatorGroup_spec.jsx
+++ 
b/superset-frontend/spec/javascripts/dashboard/components/FilterIndicatorGroup_spec.jsx
@@ -32,6 +32,13 @@ describe('FilterIndicatorGroup', () => {
         colorCode: 'badge-1',
         name: column,
         values: ['a', 'b', 'c'],
+        isFilterFieldActive: true,
+        chartId: 1,
+        componentId: 'foo',
+        directPathToFilter: ['foo'],
+        isDateFilter: false,
+        isInstantFilter: false,
+        label: 'foo',
       },
     ],
     setDirectPathToChild: () => {},
diff --git 
a/superset-frontend/spec/javascripts/dashboard/components/FilterIndicator_spec.jsx
 
b/superset-frontend/spec/javascripts/dashboard/components/FilterIndicator_spec.jsx
index 17da992..f80b462 100644
--- 
a/superset-frontend/spec/javascripts/dashboard/components/FilterIndicator_spec.jsx
+++ 
b/superset-frontend/spec/javascripts/dashboard/components/FilterIndicator_spec.jsx
@@ -32,6 +32,11 @@ describe('FilterIndicator', () => {
       name: column,
       label: column,
       values: ['a', 'b', 'c'],
+      chartId: 1,
+      componentId: 'foo',
+      isDateFilter: false,
+      isFilterFieldActive: true,
+      isInstantFilter: false,
     },
     setDirectPathToChild: jest.fn(),
   };
diff --git 
a/superset-frontend/spec/javascripts/dashboard/components/HeaderActionsDropdown_spec.jsx
 
b/superset-frontend/spec/javascripts/dashboard/components/HeaderActionsDropdown_spec.jsx
index d1e1962..033e801 100644
--- 
a/superset-frontend/spec/javascripts/dashboard/components/HeaderActionsDropdown_spec.jsx
+++ 
b/superset-frontend/spec/javascripts/dashboard/components/HeaderActionsDropdown_spec.jsx
@@ -29,21 +29,27 @@ describe('HeaderActionsDropdown', () => {
   const props = {
     addSuccessToast: () => {},
     addDangerToast: () => {},
+    customCss: '',
     dashboardId: 1,
+    dashboardInfo: {},
     dashboardTitle: 'Title',
+    editMode: false,
+    expandedSlices: {},
+    filters: {},
+    forceRefreshAllCharts: () => {},
     hasUnsavedChanges: false,
-    customCss: '',
+    isLoading: false,
+    layout: {},
     onChange: () => {},
-    updateCss: () => {},
-    forceRefreshAllCharts: () => {},
+    onSave: () => {},
+    refreshFrequency: 200,
+    setRefreshFrequency: () => {},
+    shouldPersistRefreshFrequency: true,
+    showPropertiesModal: () => {},
     startPeriodicRender: () => {},
-    editMode: false,
+    updateCss: () => {},
     userCanEdit: false,
     userCanSave: false,
-    layout: {},
-    filters: {},
-    expandedSlices: {},
-    onSave: () => {},
   };
 
   function setup(overrideProps) {
diff --git 
a/superset-frontend/spec/javascripts/explore/components/AdhocMetricEditPopover_spec.jsx
 
b/superset-frontend/spec/javascripts/explore/components/AdhocMetricEditPopover_spec.jsx
index 2f15017..b08b1d3 100644
--- 
a/superset-frontend/spec/javascripts/explore/components/AdhocMetricEditPopover_spec.jsx
+++ 
b/superset-frontend/spec/javascripts/explore/components/AdhocMetricEditPopover_spec.jsx
@@ -51,6 +51,7 @@ function setup(overrides) {
     adhocMetric: sumValueAdhocMetric,
     onChange,
     onClose,
+    onResize: () => {},
     columns,
     ...overrides,
   };
diff --git 
a/superset-frontend/spec/javascripts/explore/components/DisplayQueryButton_spec.jsx
 
b/superset-frontend/spec/javascripts/explore/components/DisplayQueryButton_spec.jsx
index 4885266..4e75cda 100644
--- 
a/superset-frontend/spec/javascripts/explore/components/DisplayQueryButton_spec.jsx
+++ 
b/superset-frontend/spec/javascripts/explore/components/DisplayQueryButton_spec.jsx
@@ -34,6 +34,7 @@ describe('DisplayQueryButton', () => {
     latestQueryFormData: {
       datasource: '1__table',
     },
+    chartHeight: '30px',
   };
 
   it('is valid', () => {
diff --git 
a/superset-frontend/spec/javascripts/explore/components/ExploreActionButtons_spec.jsx
 
b/superset-frontend/spec/javascripts/explore/components/ExploreActionButtons_spec.jsx
index 6a8b6e0..9e07f0e 100644
--- 
a/superset-frontend/spec/javascripts/explore/components/ExploreActionButtons_spec.jsx
+++ 
b/superset-frontend/spec/javascripts/explore/components/ExploreActionButtons_spec.jsx
@@ -26,6 +26,7 @@ describe('ExploreActionButtons', () => {
     canDownload: 'True',
     latestQueryFormData: {},
     queryEndpoint: 'localhost',
+    chartHeight: '30px',
   };
 
   it('renders', () => {
diff --git 
a/superset-frontend/spec/javascripts/explore/components/ExploreChartPanel_spec.jsx
 
b/superset-frontend/spec/javascripts/explore/components/ExploreChartPanel_spec.jsx
index f05c304..c50a605 100644
--- 
a/superset-frontend/spec/javascripts/explore/components/ExploreChartPanel_spec.jsx
+++ 
b/superset-frontend/spec/javascripts/explore/components/ExploreChartPanel_spec.jsx
@@ -25,6 +25,12 @@ describe('ChartContainer', () => {
     sliceName: 'Trend Line',
     vizType: 'line',
     height: '500px',
+    actions: {},
+    can_overwrite: false,
+    can_download: false,
+    containerId: 'foo',
+    width: '50px',
+    isStarred: false,
   };
 
   it('renders when vizType is line', () => {
diff --git 
a/superset-frontend/spec/javascripts/explore/components/QueryAndSaveBtns_spec.jsx
 
b/superset-frontend/spec/javascripts/explore/components/QueryAndSaveBtns_spec.jsx
index 7c32361..6410d7f 100644
--- 
a/superset-frontend/spec/javascripts/explore/components/QueryAndSaveBtns_spec.jsx
+++ 
b/superset-frontend/spec/javascripts/explore/components/QueryAndSaveBtns_spec.jsx
@@ -25,7 +25,7 @@ import Button from 'src/components/Button';
 
 describe('QueryAndSaveButtons', () => {
   const defaultProps = {
-    canAdd: 'True',
+    canAdd: true,
     onQuery: sinon.spy(),
   };
 
diff --git a/superset-frontend/spec/javascripts/sqllab/QuerySearch_spec.jsx 
b/superset-frontend/spec/javascripts/sqllab/QuerySearch_spec.jsx
index 3e6945f..d8739c5 100644
--- a/superset-frontend/spec/javascripts/sqllab/QuerySearch_spec.jsx
+++ b/superset-frontend/spec/javascripts/sqllab/QuerySearch_spec.jsx
@@ -29,6 +29,7 @@ describe('QuerySearch', () => {
   const mockedProps = {
     actions: {},
     height: 0,
+    displayLimit: 50,
   };
   it('is valid', () => {
     expect(React.isValidElement(<QuerySearch {...mockedProps} />)).toBe(true);

Reply via email to