From aa5ad147995e0b64889e20165f283f20f180860b Mon Sep 17 00:00:00 2001 From: nickofthyme Date: Thu, 28 Mar 2024 11:58:17 -0700 Subject: [PATCH] remove old chart mock for getSpecId The chart ids used to be cast as unique strings (https://github.com/markov00/elastic-charts/blame/8afa62afc4206d8ce3876aa5ccd9c69a8c20518a/src/utils/ids.ts) but this was changed in https://github.com/elastic/elastic-charts/pull/281 and fully removed in https://github.com/elastic/elastic-charts/pull/554. --- .../public/components/gauge_component.test.tsx | 18 ------------------ .../components/heatmap_component.test.tsx | 9 --------- .../partition_vis_component.test.tsx | 9 --------- .../public/utils/get_color_picker.test.tsx | 9 --------- .../common/components/charts/common.test.tsx | 9 --------- 5 files changed, 54 deletions(-) diff --git a/src/plugins/chart_expressions/expression_gauge/public/components/gauge_component.test.tsx b/src/plugins/chart_expressions/expression_gauge/public/components/gauge_component.test.tsx index ca21711d9bfb7..bb018734b497d 100644 --- a/src/plugins/chart_expressions/expression_gauge/public/components/gauge_component.test.tsx +++ b/src/plugins/chart_expressions/expression_gauge/public/components/gauge_component.test.tsx @@ -30,15 +30,6 @@ import { Color, } from '@elastic/charts'; -jest.mock('@elastic/charts', () => { - const original = jest.requireActual('@elastic/charts'); - - return { - ...original, - getSpecId: jest.fn(() => {}), - }; -}); - const numberColumn = (id = 'metric-accessor'): DatatableColumn => ({ id, name: 'Count of records', @@ -51,15 +42,6 @@ const numberColumn = (id = 'metric-accessor'): DatatableColumn => ({ }, }); -jest.mock('@elastic/charts', () => { - const original = jest.requireActual('@elastic/charts'); - - return { - ...original, - getSpecId: jest.fn(() => {}), - }; -}); - const chartsThemeService = chartPluginMock.createSetupContract().theme; const paletteThemeService = chartPluginMock.createSetupContract().palettes; const formatService = fieldFormatsServiceMock.createStartContract(); diff --git a/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.test.tsx b/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.test.tsx index bf9524c186134..86d40144c67bd 100644 --- a/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.test.tsx +++ b/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.test.tsx @@ -30,15 +30,6 @@ import HeatmapComponent from './heatmap_component'; import { LegendSize } from '@kbn/visualizations-plugin/common'; import { FieldFormat } from '@kbn/field-formats-plugin/common'; -jest.mock('@elastic/charts', () => { - const original = jest.requireActual('@elastic/charts'); - - return { - ...original, - getSpecId: jest.fn(() => {}), - }; -}); - const actWithTimeout = (action: Function, timer: number = 1) => act( () => diff --git a/src/plugins/chart_expressions/expression_partition_vis/public/components/partition_vis_component.test.tsx b/src/plugins/chart_expressions/expression_partition_vis/public/components/partition_vis_component.test.tsx index b5b2fb553676f..9d327c1272b7c 100644 --- a/src/plugins/chart_expressions/expression_partition_vis/public/components/partition_vis_component.test.tsx +++ b/src/plugins/chart_expressions/expression_partition_vis/public/components/partition_vis_component.test.tsx @@ -28,15 +28,6 @@ import { ChartTypes } from '../../common/types'; import { LegendSize } from '@kbn/visualizations-plugin/common'; import { cloneDeep } from 'lodash'; -jest.mock('@elastic/charts', () => { - const original = jest.requireActual('@elastic/charts'); - - return { - ...original, - getSpecId: jest.fn(() => {}), - }; -}); - const actWithTimeout = (action: Function, timer: number = 1) => act( () => diff --git a/src/plugins/chart_expressions/expression_partition_vis/public/utils/get_color_picker.test.tsx b/src/plugins/chart_expressions/expression_partition_vis/public/utils/get_color_picker.test.tsx index 04aa0136dcadd..14164045326c7 100644 --- a/src/plugins/chart_expressions/expression_partition_vis/public/utils/get_color_picker.test.tsx +++ b/src/plugins/chart_expressions/expression_partition_vis/public/utils/get_color_picker.test.tsx @@ -23,15 +23,6 @@ import { createMockBucketColumns, createMockVisData } from '../mocks'; const bucketColumns = createMockBucketColumns(); const visData = createMockVisData(); -jest.mock('@elastic/charts', () => { - const original = jest.requireActual('@elastic/charts'); - - return { - ...original, - getSpecId: jest.fn(() => {}), - }; -}); - describe('LegendColorPickerWrapper', () => { const mockState = new Map(); const uiState = { diff --git a/x-pack/plugins/security_solution/public/common/components/charts/common.test.tsx b/x-pack/plugins/security_solution/public/common/components/charts/common.test.tsx index 20dfc140c4138..10234da2fac2f 100644 --- a/x-pack/plugins/security_solution/public/common/components/charts/common.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/charts/common.test.tsx @@ -23,15 +23,6 @@ import { LEGACY_LIGHT_THEME, LEGACY_DARK_THEME } from '@elastic/charts'; jest.mock('../../lib/kibana'); -jest.mock('@elastic/charts', () => { - const original = jest.requireActual('@elastic/charts'); - - return { - ...original, - getSpecId: jest.fn(() => {}), - }; -}); - describe('WrappedByAutoSizer', () => { it('should render correct default height', () => { const wrapper = shallow();