From 2aaa3bc0e0b33c8c26bb881bcf859308ced3ec9c Mon Sep 17 00:00:00 2001 From: Cody Leff Date: Fri, 23 Dec 2022 00:02:08 +0000 Subject: [PATCH] Fix tests; trigger CI. --- .../Datasource/DatasourceEditor.test.jsx | 18 +++++++++++------- .../src/components/ListView/ListView.test.jsx | 6 +++++- .../HeaderReportDropdown/index.test.tsx | 6 +++++- .../ReportModal/ReportModal.test.tsx | 6 +++++- .../DndMetricSelect.test.tsx | 13 +++++++------ 5 files changed, 33 insertions(+), 16 deletions(-) diff --git a/superset-frontend/src/components/Datasource/DatasourceEditor.test.jsx b/superset-frontend/src/components/Datasource/DatasourceEditor.test.jsx index 8d592d2d6eff7..9298287322692 100644 --- a/superset-frontend/src/components/Datasource/DatasourceEditor.test.jsx +++ b/superset-frontend/src/components/Datasource/DatasourceEditor.test.jsx @@ -24,13 +24,17 @@ import DatasourceEditor from 'src/components/Datasource/DatasourceEditor'; import mockDatasource from 'spec/fixtures/mockDatasource'; import * as featureFlags from 'src/featureFlags'; -jest.mock('src/components/Icons/Icon', () => ({ fileName, role, ...rest }) => ( - -)); +jest.mock('src/components/Icons/Icon', () => ({ + __esModule: true, + default: ({ fileName, role, ...rest }) => ( + + ), + StyledIcon: () => , +})); const props = { datasource: mockDatasource['7__table'], diff --git a/superset-frontend/src/components/ListView/ListView.test.jsx b/superset-frontend/src/components/ListView/ListView.test.jsx index 5faaa6d3c3440..c070fa926d861 100644 --- a/superset-frontend/src/components/ListView/ListView.test.jsx +++ b/superset-frontend/src/components/ListView/ListView.test.jsx @@ -35,7 +35,11 @@ import Pagination from 'src/components/Pagination/Wrapper'; import waitForComponentToPaint from 'spec/helpers/waitForComponentToPaint'; -jest.mock('src/components/Icons/Icon', () => () => ); +jest.mock('src/components/Icons/Icon', () => ({ + __esModule: true, + default: () => , + StyledIcon: () => , +})); function makeMockLocation(query) { const queryStr = encodeURIComponent(query); diff --git a/superset-frontend/src/components/ReportModal/HeaderReportDropdown/index.test.tsx b/superset-frontend/src/components/ReportModal/HeaderReportDropdown/index.test.tsx index af524a6b1e309..2d6d202799648 100644 --- a/superset-frontend/src/components/ReportModal/HeaderReportDropdown/index.test.tsx +++ b/superset-frontend/src/components/ReportModal/HeaderReportDropdown/index.test.tsx @@ -24,7 +24,11 @@ import HeaderReportDropdown, { HeaderReportProps } from '.'; let isFeatureEnabledMock: jest.MockInstance; -jest.mock('src/components/Icons/Icon', () => () => ); +jest.mock('src/components/Icons/Icon', () => ({ + __esModule: true, + default: () => , + StyledIcon: () => , +})); const createProps = () => ({ dashboardId: 1, diff --git a/superset-frontend/src/components/ReportModal/ReportModal.test.tsx b/superset-frontend/src/components/ReportModal/ReportModal.test.tsx index d33d7d62e1919..ad289cefe9a82 100644 --- a/superset-frontend/src/components/ReportModal/ReportModal.test.tsx +++ b/superset-frontend/src/components/ReportModal/ReportModal.test.tsx @@ -33,7 +33,11 @@ fetchMock.get(REPORT_ENDPOINT, {}); const NOOP = () => {}; -jest.mock('src/components/Icons/Icon', () => () => ); +jest.mock('src/components/Icons/Icon', () => ({ + __esModule: true, + default: () => , + StyledIcon: () => , +})); const defaultProps = { addDangerToast: NOOP, diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.test.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.test.tsx index a54d7cbac5daa..8074525f4e5b5 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.test.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.test.tsx @@ -30,12 +30,13 @@ import { DndMetricSelect } from 'src/explore/components/controls/DndColumnSelect import { AGGREGATES } from 'src/explore/constants'; import { EXPRESSION_TYPES } from '../MetricControl/AdhocMetric'; -jest.mock( - 'src/components/Icons/Icon', - () => - ({ fileName }: { fileName: string }) => - , -); +jest.mock('src/components/Icons/Icon', () => ({ + __esModule: true, + default: ({ fileName }: { fileName: string }) => ( + + ), + StyledIcon: () => , +})); const defaultProps = { savedMetrics: [