Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import React from 'react';
import { renderReactTestingLibraryWithI18n } from '@kbn/test-jest-helpers';
import { renderWithI18n } from '@kbn/test-jest-helpers';
import '@testing-library/jest-dom';
import type { StatusInfoServiceStatus as ServiceStatus } from '@kbn/core-status-common';
import { StatusTable } from './status_table';
Expand All @@ -34,7 +34,7 @@ const createServiceStatus = (parts: Partial<ServiceStatus> = {}): ServiceStatus

describe('StatusTable', () => {
it('renders when statuses is provided', () => {
const { getByTestId, getByText } = renderReactTestingLibraryWithI18n(
const { getByTestId, getByText } = renderWithI18n(
<StatusTable
statuses={[
{ id: 'plugin:1', state, original: createServiceStatus() },
Expand Down Expand Up @@ -82,7 +82,7 @@ describe('StatusTable', () => {
});

it('renders empty when statuses is not provided', () => {
const { container } = renderReactTestingLibraryWithI18n(<StatusTable />);
const { container } = renderWithI18n(<StatusTable />);
expect(container.firstChild).toBeNull();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import React from 'react';
import { render } from '@testing-library/react';
import { I18nProvider } from '@kbn/i18n-react';

export const renderReactTestingLibraryWithI18n = (...args: Parameters<typeof render>) => {
export const renderWithI18n = (...args: Parameters<typeof render>) => {
const [ui, ...remainingRenderArgs] = args;
// Avoid using { wrapper: I18nProvider } in case the caller adds a custom wrapper.
return render(<I18nProvider>{ui}</I18nProvider>, ...remainingRenderArgs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -16,7 +16,7 @@ const queryClient = new QueryClient();

describe('Transform: Transform List <CreateTransformButton />', () => {
test('Minimal initialization', () => {
const { container } = renderReactTestingLibraryWithI18n(
const { container } = renderWithI18n(
<QueryClientProvider client={queryClient}>
<CreateTransformButton onClick={jest.fn()} transformNodes={1} />
</QueryClientProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -34,7 +34,7 @@ describe('Transform: Transform List <ExpandedRow />', () => {
// @ts-expect-error mock data is too loosely typed
const item: TransformListRow = transformListRow;

renderReactTestingLibraryWithI18n(
renderWithI18n(
<QueryClientProvider client={queryClient}>
<ExpandedRow item={item} onAlertEdit={onAlertEdit} />
</QueryClientProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -17,7 +17,7 @@ const queryClient = new QueryClient();

describe('Transform: <TransformManagementSection />', () => {
test('Minimal initialization', () => {
const { container } = renderReactTestingLibraryWithI18n(
const { container } = renderWithI18n(
<QueryClientProvider client={queryClient}>
<TransformManagementSection />
</QueryClientProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -34,9 +35,7 @@ describe('AgentDetailsJsonFlyout', () => {
});

const renderComponent = () => {
return renderReactTestingLibraryWithI18n(
<AgentDetailsJsonFlyout agent={agent} onClose={jest.fn()} />
);
return renderWithI18n(<AgentDetailsJsonFlyout agent={agent} onClose={jest.fn()} />);
};

it('renders a title with the agent id if host name is not defined', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -32,7 +32,7 @@ describe('TagOptions', () => {
});

const renderComponent = () => {
return renderReactTestingLibraryWithI18n(
return renderWithI18n(
<div>
<TagOptions tagName={'agent'} isTagHovered={isTagHovered} onTagsUpdated={onTagsUpdated} />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -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(
<SecretFormRow
title={title}
initialValue={initialValue}
Expand All @@ -44,7 +44,7 @@ describe('SecretFormRow', () => {
});

it('should not enable action links if the row is disabled', () => {
const { getByText, queryByText } = renderReactTestingLibraryWithI18n(
const { getByText, queryByText } = renderWithI18n(
<SecretFormRow
title={title}
initialValue={initialValue}
Expand All @@ -65,7 +65,7 @@ describe('SecretFormRow', () => {
});

it('should call the cancelEdit function when the cancel button is clicked', () => {
const { getByText } = renderReactTestingLibraryWithI18n(
const { getByText } = renderWithI18n(
<SecretFormRow
title={title}
initialValue={initialValue}
Expand All @@ -85,7 +85,7 @@ describe('SecretFormRow', () => {
});

it('should not display the cancel change button when no initial value is provided', () => {
const { queryByTestId } = renderReactTestingLibraryWithI18n(
const { queryByTestId } = renderWithI18n(
<SecretFormRow
title={title}
clear={clear}
Expand All @@ -102,7 +102,7 @@ describe('SecretFormRow', () => {
});

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(
<SecretFormRow
label={<div>Test Field</div>}
useSecretsStorage={false}
Expand All @@ -121,7 +121,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(
<SecretFormRow
title={title}
initialValue={initialValue}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/
import React from 'react';
import { renderReactTestingLibraryWithI18n as render } from '@kbn/test-jest-helpers';
import { renderWithI18n as render } from '@kbn/test-jest-helpers';

import { ViewInAPMButton } from './view_in_apm_button';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import React from 'react';
import { renderReactTestingLibraryWithI18n as render } from '@kbn/test-jest-helpers';
import { renderWithI18n as render } from '@kbn/test-jest-helpers';
import { HostIsolationPanel } from '.';
import { useKibana as mockUseKibana } from '../../../../lib/kibana/__mocks__';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import React from 'react';
import { renderReactTestingLibraryWithI18n as render } from '@kbn/test-jest-helpers';
import { renderWithI18n as render } from '@kbn/test-jest-helpers';
import { removeExternalLinkText } from '@kbn/securitysolution-io-ts-utils';
import { TestProviders } from '../../mock';
import { MarkdownRenderer } from './renderer';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import React from 'react';
import { EndpointActionCallout } from './callout';
import { renderReactTestingLibraryWithI18n as render } from '@kbn/test-jest-helpers';
import { renderWithI18n as render } from '@kbn/test-jest-helpers';
import { useFormData } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib';
jest.mock('@kbn/es-ui-shared-plugin/static/forms/hook_form_lib');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
import React from 'react';

import { renderReactTestingLibraryWithI18n as render } from '@kbn/test-jest-helpers';
import { renderWithI18n as render } from '@kbn/test-jest-helpers';

import { PanelHeader } from './header';
import { allThreeTabs } from './hooks/use_tabs';
Expand Down
Loading