From 8a29a960692dfdb63d8cf26db8d6f4096602f4ff Mon Sep 17 00:00:00 2001 From: Brianna Hall Date: Mon, 4 Oct 2021 13:24:58 -0400 Subject: [PATCH] Removed html_id_generator mocks. Current mock was failing due to missing useGeneratedHtmlId export. This is safe to remove because EUI contains a .testenv that contains an mock for html_id_generator. More info at https://github.com/elastic/eui/blob/master/src/services/accessibility/html_id_generator.testenv.ts --- .../public/components/cron_editor/cron_editor.test.tsx | 6 ------ .../__jest__/client_integration/helpers/jest.mocks.tsx | 6 ------ .../field_format_editor/editors/url/url.test.tsx | 6 ------ .../app/error_group_overview/List/List.test.tsx | 6 ------ .../components/shared/Stacktrace/Stackframe.test.tsx | 6 ------ .../__snapshots__/asset_manager.stories.storyshot | 8 ++++---- .../__snapshots__/expression_input.stories.storyshot | 2 +- .../__snapshots__/file_upload.stories.storyshot | 4 ++-- .../__snapshots__/workpad_table.stories.storyshot | 8 ++++---- .../components/footer/settings/settings.test.tsx | 6 +----- x-pack/plugins/canvas/storybook/storyshots.test.tsx | 7 ------- .../license_management/__jest__/add_license.test.js | 5 ----- .../__jest__/request_trial_extension.test.js | 5 ----- .../license_management/__jest__/revert_to_basic.test.js | 5 ----- .../license_management/__jest__/start_trial.test.js | 6 ------ .../reporting/public/management/report_listing.test.tsx | 6 ------ .../availability_reporting.test.tsx | 6 ------ .../availability_reporting/location_status_tags.test.tsx | 6 ------ .../overview/monitor_list/monitor_list.test.tsx | 6 ------ 19 files changed, 12 insertions(+), 98 deletions(-) diff --git a/src/plugins/es_ui_shared/public/components/cron_editor/cron_editor.test.tsx b/src/plugins/es_ui_shared/public/components/cron_editor/cron_editor.test.tsx index 26ef7483bbbbd..0ae82872124a4 100644 --- a/src/plugins/es_ui_shared/public/components/cron_editor/cron_editor.test.tsx +++ b/src/plugins/es_ui_shared/public/components/cron_editor/cron_editor.test.tsx @@ -14,12 +14,6 @@ import { mountWithI18nProvider } from '@kbn/test/jest'; import { Frequency } from './types'; import { CronEditor } from './cron_editor'; -jest.mock('@elastic/eui/lib/services/accessibility/html_id_generator', () => { - return { - htmlIdGenerator: () => () => `generated-id`, - }; -}); - describe('CronEditor', () => { ['MINUTE', 'HOUR', 'DAY', 'WEEK', 'MONTH', 'YEAR'].forEach((unit) => { test(`is rendered with a ${unit} frequency`, () => { diff --git a/src/plugins/index_pattern_field_editor/__jest__/client_integration/helpers/jest.mocks.tsx b/src/plugins/index_pattern_field_editor/__jest__/client_integration/helpers/jest.mocks.tsx index e291ec7b4ca08..d33a0d2a87fb5 100644 --- a/src/plugins/index_pattern_field_editor/__jest__/client_integration/helpers/jest.mocks.tsx +++ b/src/plugins/index_pattern_field_editor/__jest__/client_integration/helpers/jest.mocks.tsx @@ -9,12 +9,6 @@ import React from 'react'; const EDITOR_ID = 'testEditor'; -jest.mock('@elastic/eui/lib/services/accessibility', () => { - return { - htmlIdGenerator: () => () => `generated-id`, - }; -}); - jest.mock('@elastic/eui', () => { const original = jest.requireActual('@elastic/eui'); diff --git a/src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/url/url.test.tsx b/src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/url/url.test.tsx index 48d3a5dfea7c6..6394d42b691f1 100644 --- a/src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/url/url.test.tsx +++ b/src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/url/url.test.tsx @@ -15,12 +15,6 @@ import { createKibanaReactContext } from '../../../../../../kibana_react/public' import { render } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -jest.mock('@elastic/eui/lib/services/accessibility', () => { - return { - htmlIdGenerator: () => () => `generated-id`, - }; -}); - const fieldType = 'string'; const format = { getConverterFor: jest diff --git a/x-pack/plugins/apm/public/components/app/error_group_overview/List/List.test.tsx b/x-pack/plugins/apm/public/components/app/error_group_overview/List/List.test.tsx index a2a92b7e16f8e..12fa1c955ccc8 100644 --- a/x-pack/plugins/apm/public/components/app/error_group_overview/List/List.test.tsx +++ b/x-pack/plugins/apm/public/components/app/error_group_overview/List/List.test.tsx @@ -15,12 +15,6 @@ import props from './__fixtures__/props.json'; import { MemoryRouter } from 'react-router-dom'; import { EuiThemeProvider } from '../../../../../../../../src/plugins/kibana_react/common'; -jest.mock('@elastic/eui/lib/services/accessibility/html_id_generator', () => { - return { - htmlIdGenerator: () => () => `generated-id`, - }; -}); - describe('ErrorGroupOverview -> List', () => { beforeAll(() => { mockMoment(); diff --git a/x-pack/plugins/apm/public/components/shared/Stacktrace/Stackframe.test.tsx b/x-pack/plugins/apm/public/components/shared/Stacktrace/Stackframe.test.tsx index c73d312e0cf18..6bab77dbe4970 100644 --- a/x-pack/plugins/apm/public/components/shared/Stacktrace/Stackframe.test.tsx +++ b/x-pack/plugins/apm/public/components/shared/Stacktrace/Stackframe.test.tsx @@ -12,12 +12,6 @@ import { mountWithTheme } from '../../../utils/testHelpers'; import { Stackframe as StackframeComponent } from './Stackframe'; import stacktracesMock from './__fixtures__/stacktraces.json'; -jest.mock('@elastic/eui/lib/services/accessibility/html_id_generator', () => { - return { - htmlIdGenerator: () => () => `generated-id`, - }; -}); - describe('Stackframe', () => { describe('when stackframe has source lines', () => { let wrapper: ReactWrapper; diff --git a/x-pack/plugins/canvas/public/components/asset_manager/__stories__/__snapshots__/asset_manager.stories.storyshot b/x-pack/plugins/canvas/public/components/asset_manager/__stories__/__snapshots__/asset_manager.stories.storyshot index 6ef6d19e446db..45b9d896db5f2 100644 --- a/x-pack/plugins/canvas/public/components/asset_manager/__stories__/__snapshots__/asset_manager.stories.storyshot +++ b/x-pack/plugins/canvas/public/components/asset_manager/__stories__/__snapshots__/asset_manager.stories.storyshot @@ -54,7 +54,7 @@ exports[`Storyshots components/Assets/AssetManager no assets 1`] = ` >