diff --git a/src/platform/packages/shared/kbn-test-jest-helpers/src/testing_library_react_helpers.tsx b/src/platform/packages/shared/kbn-test-jest-helpers/src/testing_library_react_helpers.tsx index 64caf0529fd7f..f44ebebdcb6a6 100644 --- a/src/platform/packages/shared/kbn-test-jest-helpers/src/testing_library_react_helpers.tsx +++ b/src/platform/packages/shared/kbn-test-jest-helpers/src/testing_library_react_helpers.tsx @@ -22,7 +22,7 @@ export const renderWithKibanaRenderContext = (...args: Parameters ); }; -export const renderReactTestingLibraryWithI18n = (...args: Parameters) => { +export const renderWithI18n = (...args: Parameters) => { const [ui, ...remainingRenderArgs] = args; // Avoid using { wrapper: I18nProvider } in case the caller adds a custom wrapper. return render({ui}, ...remainingRenderArgs); diff --git a/x-pack/platform/plugins/private/transform/public/app/sections/transform_management/components/create_transform_button/create_transform_button.test.tsx b/x-pack/platform/plugins/private/transform/public/app/sections/transform_management/components/create_transform_button/create_transform_button.test.tsx index fceb52cb0cd4e..66a2e2cab1412 100644 --- a/x-pack/platform/plugins/private/transform/public/app/sections/transform_management/components/create_transform_button/create_transform_button.test.tsx +++ b/x-pack/platform/plugins/private/transform/public/app/sections/transform_management/components/create_transform_button/create_transform_button.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; -import { renderReactTestingLibraryWithI18n } from '@kbn/test-jest-helpers'; +import { renderWithI18n } from '@kbn/test-jest-helpers'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { CreateTransformButton } from './create_transform_button'; @@ -16,7 +16,7 @@ const queryClient = new QueryClient(); describe('Transform: Transform List ', () => { test('Minimal initialization', () => { - const { container } = renderReactTestingLibraryWithI18n( + const { container } = renderWithI18n( diff --git a/x-pack/platform/plugins/private/transform/public/app/sections/transform_management/components/transform_list/expanded_row.test.tsx b/x-pack/platform/plugins/private/transform/public/app/sections/transform_management/components/transform_list/expanded_row.test.tsx index 28c82d11a1c46..834d2debcf646 100644 --- a/x-pack/platform/plugins/private/transform/public/app/sections/transform_management/components/transform_list/expanded_row.test.tsx +++ b/x-pack/platform/plugins/private/transform/public/app/sections/transform_management/components/transform_list/expanded_row.test.tsx @@ -6,7 +6,7 @@ */ import { fireEvent, screen, waitFor, within } from '@testing-library/react'; -import { renderReactTestingLibraryWithI18n } from '@kbn/test-jest-helpers'; +import { renderWithI18n } from '@kbn/test-jest-helpers'; import React from 'react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import moment from 'moment-timezone'; @@ -34,7 +34,7 @@ describe('Transform: Transform List ', () => { // @ts-expect-error mock data is too loosely typed const item: TransformListRow = transformListRow; - renderReactTestingLibraryWithI18n( + renderWithI18n( diff --git a/x-pack/platform/plugins/private/transform/public/app/sections/transform_management/transform_management_section.test.tsx b/x-pack/platform/plugins/private/transform/public/app/sections/transform_management/transform_management_section.test.tsx index be4bd374eb673..23fff62b3e3da 100644 --- a/x-pack/platform/plugins/private/transform/public/app/sections/transform_management/transform_management_section.test.tsx +++ b/x-pack/platform/plugins/private/transform/public/app/sections/transform_management/transform_management_section.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { renderReactTestingLibraryWithI18n } from '@kbn/test-jest-helpers'; +import { renderWithI18n } from '@kbn/test-jest-helpers'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { TransformManagementSection } from './transform_management_section'; @@ -17,7 +17,7 @@ const queryClient = new QueryClient(); describe('Transform: ', () => { test('Minimal initialization', () => { - const { container } = renderReactTestingLibraryWithI18n( + const { container } = renderWithI18n( diff --git a/x-pack/platform/plugins/shared/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_details_json_flyout.test.tsx b/x-pack/platform/plugins/shared/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_details_json_flyout.test.tsx index cbc760548e13c..4f7337459b45f 100644 --- a/x-pack/platform/plugins/shared/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_details_json_flyout.test.tsx +++ b/x-pack/platform/plugins/shared/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_details_json_flyout.test.tsx @@ -6,7 +6,8 @@ */ import React from 'react'; -import { renderReactTestingLibraryWithI18n } from '@kbn/test-jest-helpers'; +import { renderWithI18n } from '@kbn/test-jest-helpers'; + import type { Agent } from '../../../../types'; import { useStartServices } from '../../../../hooks'; @@ -34,9 +35,7 @@ describe('AgentDetailsJsonFlyout', () => { }); const renderComponent = () => { - return renderReactTestingLibraryWithI18n( - - ); + return renderWithI18n(); }; it('renders a title with the agent id if host name is not defined', () => { diff --git a/x-pack/platform/plugins/shared/fleet/public/applications/fleet/sections/agents/agent_list_page/components/tag_options.test.tsx b/x-pack/platform/plugins/shared/fleet/public/applications/fleet/sections/agents/agent_list_page/components/tag_options.test.tsx index 047049831c160..bbae30b1914a3 100644 --- a/x-pack/platform/plugins/shared/fleet/public/applications/fleet/sections/agents/agent_list_page/components/tag_options.test.tsx +++ b/x-pack/platform/plugins/shared/fleet/public/applications/fleet/sections/agents/agent_list_page/components/tag_options.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { fireEvent, waitFor } from '@testing-library/react'; -import { renderReactTestingLibraryWithI18n } from '@kbn/test-jest-helpers'; +import { renderWithI18n } from '@kbn/test-jest-helpers'; import { useUpdateTags } from '../hooks'; @@ -32,7 +32,7 @@ describe('TagOptions', () => { }); const renderComponent = () => { - return renderReactTestingLibraryWithI18n( + return renderWithI18n(
diff --git a/x-pack/platform/plugins/shared/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/output_form_secret_form_row.test.tsx b/x-pack/platform/plugins/shared/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/output_form_secret_form_row.test.tsx index 6d735796278c7..2bc89e015f1ad 100644 --- a/x-pack/platform/plugins/shared/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/output_form_secret_form_row.test.tsx +++ b/x-pack/platform/plugins/shared/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/output_form_secret_form_row.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { fireEvent } from '@testing-library/react'; -import { renderReactTestingLibraryWithI18n } from '@kbn/test-jest-helpers'; +import { renderWithI18n } from '@kbn/test-jest-helpers'; import { SecretFormRow } from './output_form_secret_form_row'; @@ -20,7 +20,7 @@ describe('SecretFormRow', () => { const useSecretsStorage = true; it('should switch to edit mode when the replace button is clicked', () => { - const { getByText, queryByText, container } = renderReactTestingLibraryWithI18n( + const { getByText, queryByText, container } = renderWithI18n( { }); it('should not enable action links if the row is disabled', () => { - const { getByText, queryByText } = renderReactTestingLibraryWithI18n( + const { getByText, queryByText } = renderWithI18n( { }); it('should call the cancelEdit function when the cancel button is clicked', () => { - const { getByText } = renderReactTestingLibraryWithI18n( + const { getByText } = renderWithI18n( { }); it('should call the onToggleSecretStorage function when the revert link is clicked', () => { - const { getByText } = renderReactTestingLibraryWithI18n( + const { getByText } = renderWithI18n( { }); it('should not display the cancel change button when no initial value is provided', () => { - const { queryByTestId } = renderReactTestingLibraryWithI18n( + const { queryByTestId } = renderWithI18n( { }); it('should call the onToggleSecretStorage function when the use secret storage button is clicked in plain text mode', () => { - const { getByText, queryByTestId } = renderReactTestingLibraryWithI18n( + const { getByText, queryByTestId } = renderWithI18n( Test Field} useSecretsStorage={false} @@ -139,7 +139,7 @@ describe('SecretFormRow', () => { }); it('should display input normally and display a callout when the field is converted to secret storage', () => { - const { getByText, queryByText } = renderReactTestingLibraryWithI18n( + const { getByText, queryByText } = renderWithI18n(