From 3db7477e45dcd0aef6f168aba52d18307caaddba Mon Sep 17 00:00:00 2001 From: sabril <5334504+saturninoabril@users.noreply.github.com> Date: Tue, 27 Jan 2026 12:22:13 +0800 Subject: [PATCH] MM-67281: (test) Migrate Enzyme to RTL (#35029) * test: migrate enzyme to rtl * replace renderWithIntl with renderWithContext * remove jest.clearAllMocks * use userEvent * fix unrelated lint error --- .../lib/src/server/default_config.ts | 12 +- .../autosize_textarea.test.tsx.snap | 54 +- .../__snapshots__/color_input.test.tsx.snap | 582 ++++-- .../searchable_channel_list.test.tsx.snap | 281 +-- .../setting_picture.test.tsx.snap | 1492 +++++--------- .../__snapshots__/radio_setting.test.tsx.snap | 124 +- .../__snapshots__/schema_text.test.tsx.snap | 56 +- .../admin_button_outline.test.tsx.snap | 59 +- .../admin_button_outline.test.tsx | 27 +- .../__snapshots__/data_grid.test.tsx.snap | 433 ++-- .../data_grid/data_grid.test.tsx | 19 +- .../admin_console/jobs/table.test.tsx | 47 +- .../admin_console/radio_setting.test.tsx | 15 +- .../request_button.test.tsx.snap | 485 +---- .../request_button/request_button.test.tsx | 47 +- .../admin_console/schema_text.test.tsx | 40 +- .../__snapshots__/user_grid.test.tsx.snap | 1835 +++++++---------- .../user_grid/user_grid.test.tsx | 50 +- .../__snapshots__/chips_list.test.tsx.snap | 64 +- .../__snapshots__/cta_buttons.test.tsx.snap | 28 +- .../chips_list.test.tsx | 19 +- .../cta_buttons.test.tsx | 13 +- .../src/components/autosize_textarea.test.tsx | 7 +- .../backstage_header.test.tsx.snap | 51 +- .../components/backstage_header.test.tsx | 11 +- .../components/backstage_sidebar.test.tsx | 119 +- .../src/components/color_input.test.tsx | 104 +- .../infinite_scroll.test.tsx.snap | 73 +- .../__snapshots__/radio_group.test.tsx.snap | 95 +- .../site_name_and_description.test.tsx.snap | 17 +- .../__snapshots__/accordion.test.tsx.snap | 128 +- .../common/accordion/accordion.test.tsx | 91 +- .../__snapshots__/carousel.test.tsx.snap | 125 +- .../common/carousel/carousel.test.tsx | 74 +- .../common/infinite_scroll.test.tsx | 144 +- .../components/common/radio_group.test.tsx | 19 +- .../common/site_name_and_description.test.tsx | 20 +- .../__snapshots__/create_team.test.tsx.snap | 129 +- .../__snapshots__/display_name.test.tsx.snap | 116 +- .../components/display_name.test.tsx | 62 +- .../__snapshots__/team_url.test.tsx.snap | 163 +- .../components/team_url/team_url.test.tsx | 5 +- .../create_team/create_team.test.tsx | 25 +- .../max_length_input.test.tsx.snap | 25 +- .../quick_input/max_length_input.test.tsx | 18 +- .../__snapshots__/search_hint.test.tsx.snap | 468 ++--- .../search_hint/search_hint.test.tsx | 49 +- .../files_filter_menu.test.tsx.snap | 870 ++------ .../messages_or_files_selector.test.tsx.snap | 283 ++- .../search_results/files_filter_menu.test.tsx | 8 +- .../messages_or_files_selector.test.tsx | 106 +- .../search_shortcut.test.tsx.snap | 142 +- .../search_shortcut/search_shortcut.test.tsx | 60 +- .../searchable_channel_list.test.tsx | 76 +- .../src/components/setting_picture.test.tsx | 184 +- .../search_channel_suggestion.test.tsx.snap | 484 ++--- .../search_channel_suggestion.test.tsx | 42 +- .../src/tests/react_testing_utils.tsx | 1 + 58 files changed, 4350 insertions(+), 5826 deletions(-) diff --git a/e2e-tests/playwright/lib/src/server/default_config.ts b/e2e-tests/playwright/lib/src/server/default_config.ts index f7bba0c0baa..9bbbcab53a1 100644 --- a/e2e-tests/playwright/lib/src/server/default_config.ts +++ b/e2e-tests/playwright/lib/src/server/default_config.ts @@ -844,15 +844,19 @@ const defaultServerConfig: AdminConfig = { AutoTranslationSettings: { Enable: false, Provider: '', - LibreTranslate: { - URL: '', - APIKey: '', - }, + TargetLanguages: ['en'], TimeoutsMs: { Short: 1200, Medium: 2500, Long: 6000, Notification: 300, }, + LibreTranslate: { + URL: '', + APIKey: '', + }, + Agents: { + LLMServiceID: '', + }, }, }; diff --git a/webapp/channels/src/components/__snapshots__/autosize_textarea.test.tsx.snap b/webapp/channels/src/components/__snapshots__/autosize_textarea.test.tsx.snap index f9312c65660..e0fc1f8d7af 100644 --- a/webapp/channels/src/components/__snapshots__/autosize_textarea.test.tsx.snap +++ b/webapp/channels/src/components/__snapshots__/autosize_textarea.test.tsx.snap @@ -2,43 +2,27 @@ exports[`components/AutosizeTextarea should match snapshot, init 1`] = `
-