At the moment it looks like to be able to migrate to React 18, we need to migrate tests using enzyme to @testing-library/react, since Enzyme officially supporting React 18 looks still unlikely (see e.g. https://github.com/enzymejs/enzyme/issues/2524, https://dev.to/wojtekmaj/enzyme-is-dead-now-what-ekl). When porting these tests, we should also try to avoid the use of existing snapshots again and refactor to more useful tests that assert rendered content and act on the components so we rely less on implementation details. And since we write new tests with @testing-library/react only anyway, we should aim to migrate these tests so we rely on one framework only eventually.
At the moment it looks like to be able to migrate to React 18, we need to migrate tests using
enzyme
to@testing-library/react
, since Enzyme officially supporting React 18 looks still unlikely (see e.g. https://github.com/enzymejs/enzyme/issues/2524, https://dev.to/wojtekmaj/enzyme-is-dead-now-what-ekl). When porting these tests, we should also try to avoid the use of existing snapshots again and refactor to more useful tests that assert rendered content and act on the components so we rely less on implementation details. And since we write new tests with@testing-library/react
only anyway, we should aim to migrate these tests so we rely on one framework only eventually.plugins/ml
x-pack/plugins/ml/public/application/components/controls/select_interval/select_interval.test.tsx
https://github.com/elastic/kibana/pull/153321x-pack/plugins/ml/public/application/components/controls/select_severity/select_severity.test.tsx
https://github.com/elastic/kibana/pull/153321x-pack/plugins/ml/public/application/components/job_selector/timerange_bar/timerange_bar.test.js
x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/outlier_exploration.test.tsx
x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/create_analytics_button/create_analytics_button.test.tsx
x-pack/plugins/ml/public/application/explorer/components/explorer_no_influencers_found/explorer_no_influencers_found.test.js
x-pack/plugins/ml/public/application/explorer/components/explorer_no_results_found/explorer_no_results_found.test.js
x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container.test.js
x-pack/plugins/ml/public/application/explorer/explorer_charts/components/explorer_chart_label/explorer_chart_label_badge.test.js
x-pack/plugins/ml/public/application/explorer/explorer_charts/components/explorer_chart_label/explorer_chart_label.test.js
x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/editor.test.tsx
react-testing-lib
that don't assert implementation details.x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/list.test.tsx
x-pack/plugins/ml/public/application/settings/filter_lists/components/filter_list_usage_popover/filter_list_usage_popover.test.js
plugins/transform
x-pack/plugins/transform/public/app/sections/create_transform/components/aggregation_list/agg_label_form.test.tsx
x-pack/plugins/transform/public/app/sections/create_transform/components/aggregation_list/list_form.test.tsx
x-pack/plugins/transform/public/app/sections/create_transform/components/aggregation_list/list_summary.test.tsx
x-pack/plugins/transform/public/app/sections/create_transform/components/aggregation_list/popover_form.test.tsx
x-pack/plugins/transform/public/app/sections/create_transform/components/group_by_list/group_by_label_form.test.tsx
x-pack/plugins/transform/public/app/sections/create_transform/components/group_by_list/group_by_label_summary.test.tsx
x-pack/plugins/transform/public/app/sections/create_transform/components/group_by_list/list_form.test.tsx
x-pack/plugins/transform/public/app/sections/create_transform/components/group_by_list/list_summary.test.tsx
x-pack/plugins/transform/public/app/sections/create_transform/components/group_by_list/popover_form.test.tsx
x-pack/plugins/transform/public/app/sections/transform_management/transform_management_section.test.tsx
x-pack/plugins/transform/public/app/sections/transform_management/components/action_delete/delete_action_name.test.tsx
x-pack/plugins/transform/public/app/sections/transform_management/components/action_start/start_action_name.test.tsx
x-pack/plugins/transform/public/app/sections/transform_management/components/action_stop/stop_action_name.test.tsx
x-pack/plugins/transform/public/app/sections/transform_management/components/create_transform_button/create_transform_button.test.tsx
x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row_details_pane.test.tsx
x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row_json_pane.test.tsx
x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row_json_pane.test.tsx