mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[testing] replace testing-library/dom package with testing-library/react (#170594)
## Summary Removes `testing-library/dom` from dependencies. As all the utilities from`dom` are available already in `testing-library/react`, there's no need to have both `dom` and `react` libraries available in our package.json. Following the [@testing-library/react documentation:](https://testing-library.com/docs/react-testing-library/intro) > [React Testing Library](https://github.com/testing-library/react-testing-library) builds on top of DOM Testing Library by adding APIs for working with React components. Let's just import everything from `testing-library/react`, this way we won't need to worry about inconsistencies between `testing-library/dom` we have in our `package.json` and the one that is `testing-library/react` dependency.
This commit is contained in:
parent
c72d4d3372
commit
3a784106df
97 changed files with 108 additions and 130 deletions
|
@ -1276,7 +1276,6 @@
|
|||
"@storybook/react-docgen-typescript-plugin": "^1.0.1",
|
||||
"@storybook/testing-react": "^1.3.0",
|
||||
"@storybook/theming": "^6.5.16",
|
||||
"@testing-library/dom": "^8.19.0",
|
||||
"@testing-library/jest-dom": "^5.16.5",
|
||||
"@testing-library/react": "^12.1.5",
|
||||
"@testing-library/react-hooks": "^8.0.1",
|
||||
|
|
|
@ -13,8 +13,8 @@ import {
|
|||
EuiDataGridRefProps,
|
||||
type EuiDataGridColumnCellAction,
|
||||
} from '@elastic/eui';
|
||||
import { render, waitFor } from '@testing-library/react';
|
||||
import { act, renderHook } from '@testing-library/react-hooks';
|
||||
import { render, waitFor, act } from '@testing-library/react';
|
||||
import { renderHook } from '@testing-library/react-hooks';
|
||||
import { makeAction } from '../mocks/helpers';
|
||||
import {
|
||||
useDataGridColumnsCellActions,
|
||||
|
|
|
@ -24,7 +24,7 @@ jest.mock('@elastic/eui', () => ({
|
|||
}));
|
||||
|
||||
import * as eui from '@elastic/eui';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
import { ResizableLayoutDirection } from '../types';
|
||||
|
||||
describe('Panels resizable', () => {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||
* Side Public License, v 1.
|
||||
*/
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
import { act, renderHook } from '@testing-library/react-hooks';
|
||||
import { useExceptionListHeader } from './use_list_header';
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
import { render } from '@testing-library/react';
|
||||
import { renderHook } from '@testing-library/react-hooks';
|
||||
import {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import { createInteractionPositionTracker } from './open_context_menu';
|
||||
import { fireEvent } from '@testing-library/dom';
|
||||
import { fireEvent } from '@testing-library/react';
|
||||
|
||||
let targetEl: Element;
|
||||
const top = 100;
|
||||
|
|
|
@ -10,7 +10,7 @@ import { ActionDefinition } from '../actions';
|
|||
import { openContextMenu } from '../context_menu';
|
||||
import { uiActionsPluginMock } from '../mocks';
|
||||
import type { Trigger } from '@kbn/ui-actions-browser';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
|
||||
jest.mock('../context_menu');
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ import { renderHook } from '@testing-library/react-hooks';
|
|||
import { dataPluginMock } from '@kbn/data-plugin/public/mocks';
|
||||
import { searchSourceInstanceMock } from '@kbn/data-plugin/common/search/search_source/mocks';
|
||||
import { of, Subject, throwError } from 'rxjs';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
import { RequestAdapter } from '@kbn/inspector-plugin/common';
|
||||
import { DataViewType, SearchSourceSearchOptions } from '@kbn/data-plugin/common';
|
||||
import { expressionsPluginMock } from '@kbn/expressions-plugin/public/mocks';
|
||||
|
|
|
@ -15,8 +15,7 @@ import {
|
|||
import React from 'react';
|
||||
import { I18nProvider } from '@kbn/i18n-react';
|
||||
import { mount } from 'enzyme';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { render } from '@testing-library/react';
|
||||
import { waitFor, render } from '@testing-library/react';
|
||||
|
||||
import { EuiTextArea, EuiIcon } from '@elastic/eui';
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
import { useGetAppUrl, useNavigateTo } from './navigation';
|
||||
import { mockGetUrlForApp, mockNavigateToApp, mockNavigateToUrl } from '../mocks/context';
|
||||
import { renderHook } from '@testing-library/react-hooks';
|
||||
import { fireEvent } from '@testing-library/dom';
|
||||
import { fireEvent } from '@testing-library/react';
|
||||
|
||||
jest.mock('./context');
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
import { act, renderHook } from '@testing-library/react-hooks/dom';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
|
||||
import { MaintenanceWindow } from '../pages/maintenance_windows/types';
|
||||
import { AppMockRenderer, createAppMockRenderer } from '../lib/test_utils';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
import { act, renderHook } from '@testing-library/react-hooks/dom';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
|
||||
import { MaintenanceWindow } from '../pages/maintenance_windows/types';
|
||||
import { AppMockRenderer, createAppMockRenderer } from '../lib/test_utils';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
import { renderHook } from '@testing-library/react-hooks/dom';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
|
||||
import { AppMockRenderer, createAppMockRenderer } from '../lib/test_utils';
|
||||
import { useFindMaintenanceWindows } from './use_find_maintenance_windows';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
import { act, renderHook } from '@testing-library/react-hooks/dom';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
|
||||
import { MaintenanceWindow } from '../pages/maintenance_windows/types';
|
||||
import { AppMockRenderer, createAppMockRenderer } from '../lib/test_utils';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
import { act, renderHook } from '@testing-library/react-hooks/dom';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
|
||||
import { MaintenanceWindow } from '../pages/maintenance_windows/types';
|
||||
import { AppMockRenderer, createAppMockRenderer } from '../lib/test_utils';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
import { renderHook } from '@testing-library/react-hooks/dom';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
|
||||
import { AppMockRenderer, createAppMockRenderer } from '../lib/test_utils';
|
||||
import { useGetMaintenanceWindow } from './use_get_maintenance_window';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
import { act, renderHook } from '@testing-library/react-hooks/dom';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
|
||||
import { MaintenanceWindow } from '../pages/maintenance_windows/types';
|
||||
import { AppMockRenderer, createAppMockRenderer } from '../lib/test_utils';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { Query } from '@elastic/eui';
|
||||
import { fireEvent } from '@testing-library/dom';
|
||||
import { fireEvent } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
|
||||
import { AppMockRenderer, createAppMockRenderer } from '../../../lib/test_utils';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { fireEvent } from '@testing-library/dom';
|
||||
import { fireEvent } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
|
||||
import { AppMockRenderer, createAppMockRenderer } from '../../../lib/test_utils';
|
||||
|
|
|
@ -11,6 +11,7 @@ import React from 'react';
|
|||
import { MemoryRouter } from 'react-router-dom';
|
||||
import { ThemeProvider } from 'styled-components';
|
||||
|
||||
import { render as reactRender } from '@testing-library/react';
|
||||
import type { RenderOptions, RenderResult } from '@testing-library/react';
|
||||
import type { ILicense } from '@kbn/licensing-plugin/public';
|
||||
import type { ScopedFilesClient } from '@kbn/files-plugin/public';
|
||||
|
@ -20,7 +21,6 @@ import { I18nProvider } from '@kbn/i18n-react';
|
|||
import { createMockFilesClient } from '@kbn/shared-ux-file-mocks';
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
|
||||
import { render as reactRender } from '@testing-library/react';
|
||||
import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public';
|
||||
import { FilesContext } from '@kbn/shared-ux-file-context';
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ import { alertComment, basicComment, mockCase } from '../containers/mock';
|
|||
import React from 'react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import type { SupportedCaseAttachment } from '../types';
|
||||
import { getByTestId } from '@testing-library/dom';
|
||||
import { getByTestId } from '@testing-library/react';
|
||||
import { OWNER_INFO } from '../../common/constants';
|
||||
|
||||
jest.mock('./lib/kibana');
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
import { act, renderHook } from '@testing-library/react-hooks';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import React from 'react';
|
||||
|
|
|
@ -10,7 +10,7 @@ import React from 'react';
|
|||
import type { AppMockRenderer } from '../../common/mock';
|
||||
import { createAppMockRenderer } from '../../common/mock';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
import { waitForEuiPopoverOpen } from '@elastic/eui/lib/test/rtl';
|
||||
import { SeverityFilter } from './severity_filter';
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
import { renderHook } from '@testing-library/react-hooks/dom';
|
||||
|
||||
import { useActions } from './use_actions';
|
||||
|
|
|
@ -13,7 +13,7 @@ import { basicCase, basicPush } from '../../containers/mock';
|
|||
import { Actions } from './actions';
|
||||
import * as i18n from '../case_view/translations';
|
||||
import * as api from '../../containers/api';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
|
||||
jest.mock('../../containers/api');
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
import { OBSERVABILITY_OWNER } from '../../../../common/constants';
|
||||
import { alertCommentWithIndices, basicCase } from '../../../containers/mock';
|
||||
import type { AppMockRenderer } from '../../../common/mock';
|
||||
|
|
|
@ -30,7 +30,7 @@ import { useGetSupportedActionConnectors } from '../../containers/configure/use_
|
|||
import type { AppMockRenderer } from '../../common/mock';
|
||||
import { createAppMockRenderer } from '../../common/mock';
|
||||
import CaseView from '.';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
import { useGetTags } from '../../containers/use_get_tags';
|
||||
import { casesQueriesKeys } from '../../containers/constants';
|
||||
import {
|
||||
|
|
|
@ -7,8 +7,7 @@
|
|||
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import { act, render, within, fireEvent } from '@testing-library/react';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { act, render, within, fireEvent, waitFor } from '@testing-library/react';
|
||||
import { licensingMock } from '@kbn/licensing-plugin/public/mocks';
|
||||
|
||||
import { NONE_CONNECTOR_ID } from '../../../common/constants';
|
||||
|
|
|
@ -15,7 +15,7 @@ import { Severity } from './severity';
|
|||
import type { FormProps } from './schema';
|
||||
import { schema } from './schema';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
import { waitForEuiPopoverOpen } from '@elastic/eui/lib/test/rtl';
|
||||
|
||||
let globalForm: FormHook;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import React from 'react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { screen, waitFor } from '@testing-library/dom';
|
||||
import { screen, waitFor } from '@testing-library/react';
|
||||
|
||||
import type { AppMockRenderer } from '../../common/mock';
|
||||
import { createAppMockRenderer } from '../../common/mock';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { screen } from '@testing-library/dom';
|
||||
import { screen } from '@testing-library/react';
|
||||
|
||||
import type { AppMockRenderer } from '../../common/mock';
|
||||
import { createAppMockRenderer } from '../../common/mock';
|
||||
|
|
|
@ -24,7 +24,7 @@ import {
|
|||
mockTimeRange,
|
||||
} from './mocks';
|
||||
import { useKibana } from '../../../common/lib/kibana';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
import { canUseCases } from '../../../client/helpers/can_use_cases';
|
||||
import { getCaseOwnerByAppId } from '../../../../common/utils/owner';
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import { LENS_EMBEDDABLE_TYPE, type Embeddable as LensEmbeddable } from '@kbn/lens-plugin/public';
|
||||
import { ErrorEmbeddable } from '@kbn/embeddable-plugin/public';
|
||||
import type { Action } from '@kbn/ui-actions-plugin/public';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
|
||||
import { createAddToNewCaseLensAction } from './add_to_new_case';
|
||||
import type { ActionContext } from './types';
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import { renderHook } from '@testing-library/react-hooks';
|
||||
import { useGetCaseConfiguration } from './use_get_case_configuration';
|
||||
import * as api from './api';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
import { useToasts } from '../../common/lib/kibana';
|
||||
import type { AppMockRenderer } from '../../common/mock';
|
||||
import { createAppMockRenderer } from '../../common/mock';
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import { renderHook } from '@testing-library/react-hooks';
|
||||
import { useGetCase } from './use_get_case';
|
||||
import * as api from './api';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import { useToasts } from '../common/lib/kibana';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { renderHook } from '@testing-library/react-hooks';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
import { useToasts } from '../common/lib/kibana';
|
||||
import type { AppMockRenderer } from '../common/mock';
|
||||
import { createAppMockRenderer } from '../common/mock';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { mockCases } from '../../../../mocks';
|
||||
import { getByText } from '@testing-library/dom';
|
||||
import { getByText } from '@testing-library/react';
|
||||
import { assigneesTemplateRenderer } from './renderer';
|
||||
import type { CaseSavedObjectTransformed } from '../../../../common/types/case';
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { mockCases } from '../../../../mocks';
|
||||
import { getByText } from '@testing-library/dom';
|
||||
import { getByText } from '@testing-library/react';
|
||||
import { assigneesTemplateRenderer } from './renderer';
|
||||
import type { CaseSavedObjectTransformed } from '../../../../common/types/case';
|
||||
|
||||
|
|
|
@ -6,13 +6,12 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { render } from '@testing-library/react';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { expectIdsInDoc } from '../../../test/utils';
|
||||
import { DASHBOARD_COUNTER_CARDS } from '../test_subjects';
|
||||
import { SummarySection } from './summary_section';
|
||||
import { mockDashboardData } from '../mock';
|
||||
import { TestProvider } from '../../../test/test_provider';
|
||||
import { screen } from '@testing-library/react';
|
||||
import { KSPM_POLICY_TEMPLATE } from '../../../../common/constants';
|
||||
|
||||
describe('<CloudSummarySection />', () => {
|
||||
|
|
|
@ -13,7 +13,7 @@ import { engines } from '../../__mocks__/engines.mock';
|
|||
|
||||
import React from 'react';
|
||||
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import { EuiComboBox, EuiComboBoxOptionOption, EuiRadioGroup } from '@elastic/eui';
|
||||
|
|
|
@ -11,7 +11,7 @@ import { setMockActions, setMockValues } from '../../../__mocks__/kea_logic';
|
|||
|
||||
import React from 'react';
|
||||
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import { EuiComboBox, EuiComboBoxOptionOption, EuiRadioGroup } from '@elastic/eui';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { render } from '../../rtl_helpers';
|
||||
import { fireEvent, screen } from '@testing-library/dom';
|
||||
import { fireEvent, screen } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { sampleAttribute } from '../../configurations/test_data/sample_attribute';
|
||||
import * as pluginHook from '../../../../../hooks/use_plugin_context';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { screen } from '@testing-library/dom';
|
||||
import { screen } from '@testing-library/react';
|
||||
import { render, mockAppDataView } from './rtl_helpers';
|
||||
import { ExploratoryView } from './exploratory_view';
|
||||
import * as obsvDataViews from '../../../utils/observability_data_views/observability_data_views';
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import React from 'react';
|
||||
import { render, forNearestButton } from '../rtl_helpers';
|
||||
import { fireEvent } from '@testing-library/dom';
|
||||
import { fireEvent } from '@testing-library/react';
|
||||
import { AddToCaseAction } from './add_to_case_action';
|
||||
import * as useCaseHook from '../hooks/use_add_to_case';
|
||||
import * as datePicker from '../components/date_range_picker';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { screen } from '@testing-library/dom';
|
||||
import { screen } from '@testing-library/react';
|
||||
import { render } from '../rtl_helpers';
|
||||
import { ChartCreationInfo } from './chart_creation_info';
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ import { useAddToCase } from './use_add_to_case';
|
|||
import React, { useEffect } from 'react';
|
||||
import { render } from '../rtl_helpers';
|
||||
import { EuiButton } from '@elastic/eui';
|
||||
import { fireEvent } from '@testing-library/dom';
|
||||
import { fireEvent } from '@testing-library/react';
|
||||
import { act } from '@testing-library/react';
|
||||
|
||||
describe('useAddToCase', function () {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { screen, waitFor, fireEvent } from '@testing-library/dom';
|
||||
import { screen, waitFor, fireEvent } from '@testing-library/react';
|
||||
import { render } from '../rtl_helpers';
|
||||
import { AddSeriesButton } from './add_series_button';
|
||||
import { DEFAULT_TIME, ReportTypes } from '../configurations/constants';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { screen, waitFor, fireEvent } from '@testing-library/dom';
|
||||
import { screen, waitFor, fireEvent } from '@testing-library/react';
|
||||
import { render } from '../rtl_helpers';
|
||||
import * as hooks from '../hooks/use_series_storage';
|
||||
import { ViewActions } from './view_actions';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { fireEvent } from '@testing-library/dom';
|
||||
import { fireEvent } from '@testing-library/react';
|
||||
|
||||
import { createFleetTestRendererMock } from '../../../../../../mock';
|
||||
import type { Agent, AgentPolicy } from '../../../../types';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { fireEvent, waitFor } from '@testing-library/dom';
|
||||
import { fireEvent, waitFor } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
|
||||
import { createFleetTestRendererMock } from '../../../../../../mock';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { fireEvent } from '@testing-library/dom';
|
||||
import { fireEvent } from '@testing-library/react';
|
||||
|
||||
import { createFleetTestRendererMock } from '../../../../../../mock';
|
||||
import type { Agent, AgentPolicy } from '../../../../types';
|
||||
|
|
|
@ -10,7 +10,7 @@ import { AppContextTestRender, createAppRootMockRenderer } from '../../test';
|
|||
import { GlobalFilter } from '../../types';
|
||||
import { CountWidget, LOADING_TEST_ID, TOOLTIP_TEST_ID, VALUE_TEST_ID } from '.';
|
||||
import { useFetchCountWidgetData } from './hooks';
|
||||
import { fireEvent, waitFor } from '@testing-library/dom';
|
||||
import { fireEvent, waitFor } from '@testing-library/react';
|
||||
|
||||
const TITLE = 'Count Widget Title';
|
||||
const GLOBAL_FILTER: GlobalFilter = {
|
||||
|
|
|
@ -13,26 +13,14 @@ import { act } from 'react-dom/test-utils';
|
|||
import { PreloadedState } from '@reduxjs/toolkit';
|
||||
import { RenderOptions, render } from '@testing-library/react';
|
||||
import { I18nProvider } from '@kbn/i18n-react';
|
||||
// imported to prevent a type error from testing library https://github.com/testing-library/react-testing-library/issues/587
|
||||
import * as ___ from '@testing-library/dom';
|
||||
|
||||
import { LensAppServices } from '../app_plugin/types';
|
||||
import {
|
||||
makeConfigureStore,
|
||||
LensAppState,
|
||||
LensState,
|
||||
LensStoreDeps,
|
||||
LensRootStore,
|
||||
} from '../state_management';
|
||||
import { makeConfigureStore, LensAppState, LensState, LensStoreDeps } from '../state_management';
|
||||
import { getResolvedDateRange } from '../utils';
|
||||
import { DatasourceMap, VisualizationMap } from '../types';
|
||||
import { mockVisualizationMap } from './visualization_mock';
|
||||
import { mockDatasourceMap } from './datasource_mock';
|
||||
import { makeDefaultServices } from './services_mock';
|
||||
|
||||
// preventing a type error from testing library https://github.com/testing-library/react-testing-library/issues/587
|
||||
export const unusedFn = () => ___;
|
||||
|
||||
export const mockStoreDeps = (deps?: {
|
||||
lensServices?: LensAppServices;
|
||||
datasourceMap?: DatasourceMap;
|
||||
|
@ -85,7 +73,8 @@ export const renderWithReduxStore = (
|
|||
preloadedState: {},
|
||||
storeDeps: mockStoreDeps(),
|
||||
}
|
||||
): ReturnType<typeof render> & { store: LensRootStore } => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
): any => {
|
||||
const { store } = makeLensStore({ preloadedState, storeDeps });
|
||||
|
||||
const Wrapper: React.FC<{
|
||||
|
|
|
@ -25,7 +25,7 @@ import { useFindListsBySize } from '@kbn/securitysolution-list-hooks';
|
|||
import type { FieldSpec } from '@kbn/data-plugin/common';
|
||||
import { fields, getField } from '@kbn/data-plugin/common/mocks';
|
||||
import { unifiedSearchPluginMock } from '@kbn/unified-search-plugin/public/mocks';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
import { ReactWrapper, mount } from 'enzyme';
|
||||
|
||||
import { getFoundListsBySizeSchemaMock } from '../../../../common/schemas/response/found_lists_by_size_schema.mock';
|
||||
|
|
|
@ -5,8 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { fireEvent, waitFor } from '@testing-library/dom';
|
||||
import { cleanup } from '@testing-library/react';
|
||||
import { fireEvent, waitFor, cleanup } from '@testing-library/react';
|
||||
import { createBrowserHistory } from 'history';
|
||||
import React from 'react';
|
||||
import Router from 'react-router-dom';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
import { mount } from 'enzyme';
|
||||
import type { ReactWrapper } from 'enzyme';
|
||||
import React from 'react';
|
||||
|
|
|
@ -15,7 +15,7 @@ import { mockAnomalies } from '../mock';
|
|||
import { TestProviders } from '../../../mock/test_providers';
|
||||
import { useMountAppended } from '../../../utils/use_mount_appended';
|
||||
import type { Anomalies } from '../types';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
|
||||
jest.mock('../../../lib/kibana');
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ import { TestProviders } from '../../../mock/test_providers';
|
|||
import { getEmptyValue } from '../../empty_value';
|
||||
import type { Anomalies } from '../types';
|
||||
import { useMountAppended } from '../../../utils/use_mount_appended';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
|
||||
jest.mock('../../../lib/kibana');
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import { mockAnomalies } from '../mock';
|
|||
import { createDescriptionList } from './create_description_list';
|
||||
import { EuiDescriptionList } from '@elastic/eui';
|
||||
import type { Anomaly } from '../types';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
|
||||
jest.mock('../../../lib/kibana');
|
||||
|
||||
|
|
|
@ -10,8 +10,7 @@ import React from 'react';
|
|||
import type { PopoverItemsProps } from '.';
|
||||
import { PopoverItems } from '.';
|
||||
import { TestProviders } from '../../mock';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { within } from '@testing-library/dom';
|
||||
import { render, screen, within } from '@testing-library/react';
|
||||
import { waitForEuiPopoverOpen } from '@elastic/eui/lib/test/rtl';
|
||||
|
||||
const mockTags = ['Elastic', 'Endpoint', 'Data Protection', 'ML', 'Continuous Monitoring'];
|
||||
|
|
|
@ -22,7 +22,7 @@ import {
|
|||
} from '../../mock';
|
||||
import { createStore } from '../../store';
|
||||
import type { EuiSuperSelectOption } from '@elastic/eui/src/components/form/super_select/super_select_control';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
import { useSourcererDataView } from '../../containers/sourcerer';
|
||||
import { useSignalHelpers } from '../../containers/sourcerer/use_signal_helpers';
|
||||
import { TimelineId } from '../../../../common/types/timeline';
|
||||
|
|
|
@ -6,9 +6,8 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { fireEvent, render as rTLRender } from '@testing-library/react';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { act, renderHook } from '@testing-library/react-hooks';
|
||||
import { fireEvent, render as rTLRender, waitFor, act } from '@testing-library/react';
|
||||
import { renderHook } from '@testing-library/react-hooks';
|
||||
import type { EuiTableFieldDataColumnType } from '@elastic/eui';
|
||||
import type { Rule } from '../../../../rule_management/logic/types';
|
||||
import { getRulesSchemaMock } from '../../../../../../common/api/detection_engine/model/rule_schema/mocks';
|
||||
|
|
|
@ -10,8 +10,7 @@
|
|||
import React, { memo, useEffect } from 'react';
|
||||
import { EuiCode } from '@elastic/eui';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { act } from '@testing-library/react';
|
||||
import { within } from '@testing-library/dom';
|
||||
import { act, within } from '@testing-library/react';
|
||||
import { convertToTestId } from './components/command_list';
|
||||
import { Console } from './console';
|
||||
import type {
|
||||
|
|
|
@ -9,10 +9,9 @@ import React from 'react';
|
|||
import type { AppContextTestRender } from '../../../../../../common/mock/endpoint';
|
||||
import { createAppRootMockRenderer } from '../../../../../../common/mock/endpoint';
|
||||
import { endpointPageHttpMock } from '../../../mocks';
|
||||
import { act, waitFor, cleanup } from '@testing-library/react';
|
||||
import { act, waitFor, cleanup, fireEvent } from '@testing-library/react';
|
||||
import { getEndpointListPath } from '../../../../../common/routing';
|
||||
import { AdminSearchBar } from '../search_bar';
|
||||
import { fireEvent } from '@testing-library/dom';
|
||||
import { uiQueryParams } from '../../../store/selectors';
|
||||
import type { EndpointIndexUIQueryParams } from '../../../types';
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import { PolicyArtifactsAssignableList } from './policy_artifacts_assignable_lis
|
|||
import * as reactTestingLibrary from '@testing-library/react';
|
||||
import type { AppContextTestRender } from '../../../../../../common/mock/endpoint';
|
||||
import { createAppRootMockRenderer } from '../../../../../../common/mock/endpoint';
|
||||
import { fireEvent } from '@testing-library/dom';
|
||||
import { fireEvent } from '@testing-library/react';
|
||||
import { getMockListResponse } from '../../../test_utils';
|
||||
|
||||
describe('Policy artifacts list', () => {
|
||||
|
|
|
@ -17,7 +17,7 @@ import type { AdvancedSectionProps } from './advanced_section';
|
|||
import { AdvancedSection } from './advanced_section';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { AdvancedPolicySchema } from '../../../models/advanced_policy_schema';
|
||||
import { within } from '@testing-library/dom';
|
||||
import { within } from '@testing-library/react';
|
||||
import { set } from 'lodash';
|
||||
|
||||
jest.mock('../../../../../../common/hooks/use_license');
|
||||
|
|
|
@ -18,7 +18,7 @@ import { OperatingSystem } from '@kbn/securitysolution-utils';
|
|||
import { expectIsViewOnly, exactMatchText } from '../mocks';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { cloneDeep, set } from 'lodash';
|
||||
import { within } from '@testing-library/dom';
|
||||
import { within } from '@testing-library/react';
|
||||
|
||||
describe('Policy Event Collection Card common component', () => {
|
||||
let formProps: EventCollectionCardProps<OperatingSystem.WINDOWS>;
|
||||
|
|
|
@ -21,7 +21,7 @@ import { buildGlobalQuery } from '../helpers';
|
|||
|
||||
import type { QueryBarTimelineComponentProps } from '.';
|
||||
import { QueryBarTimeline, getDataProviderFilter, TIMELINE_FILTER_DROP_AREA } from '.';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
|
||||
const mockUiSettingsForFilterManager = coreMock.createStart().uiSettings;
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import React from 'react';
|
|||
import { AppContextTestRender, createAppRootMockRenderer } from '../../test';
|
||||
import { DetailPanelAlertTab } from '.';
|
||||
import { mockAlerts } from '../../../common/mocks/constants/session_view_process.mock';
|
||||
import { fireEvent } from '@testing-library/dom';
|
||||
import { fireEvent } from '@testing-library/react';
|
||||
import { INVESTIGATED_ALERT_TEST_ID, VIEW_MODE_TOGGLE, ALERTS_TAB_EMPTY_STATE_TEST_ID } from '.';
|
||||
import {
|
||||
ALERT_LIST_ITEM_TEST_ID,
|
||||
|
|
|
@ -10,7 +10,7 @@ import { processMock } from '../../../common/mocks/constants/session_view_proces
|
|||
import { AppContextTestRender, createAppRootMockRenderer } from '../../test';
|
||||
import { SessionViewSearchBar } from '.';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { fireEvent } from '@testing-library/dom';
|
||||
import { fireEvent } from '@testing-library/react';
|
||||
|
||||
describe('SessionViewSearchBar component', () => {
|
||||
let render: () => ReturnType<AppContextTestRender['render']>;
|
||||
|
|
|
@ -7,14 +7,12 @@
|
|||
|
||||
import React from 'react';
|
||||
import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers';
|
||||
import { act } from 'react-dom/test-utils';
|
||||
import SwimlaneActionConnectorFields from './swimlane_connectors';
|
||||
import { useGetApplication } from './use_get_application';
|
||||
import { applicationFields, mappings } from './mocks';
|
||||
import { ConnectorFormTestProvider } from '../lib/test_utils';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor, render, act } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { render } from '@testing-library/react';
|
||||
|
||||
jest.mock('@kbn/triggers-actions-ui-plugin/public/common/lib/kibana');
|
||||
jest.mock('./use_get_application');
|
||||
|
|
|
@ -10,7 +10,7 @@ import { SyntheticsDatePicker } from './synthetics_date_picker';
|
|||
import { startPlugins } from '../../../utils/testing/__mocks__/synthetics_plugin_start_mock';
|
||||
import { createMemoryHistory } from 'history';
|
||||
import { render } from '../../../utils/testing';
|
||||
import { fireEvent } from '@testing-library/dom';
|
||||
import { fireEvent } from '@testing-library/react';
|
||||
|
||||
describe('SyntheticsDatePicker component', () => {
|
||||
jest.setTimeout(10_000);
|
||||
|
|
|
@ -12,10 +12,9 @@ import {
|
|||
WEBSITE_URL_HELP_TEXT,
|
||||
WEBSITE_URL_LABEL,
|
||||
} from './simple_monitor_form';
|
||||
import { screen } from '@testing-library/react';
|
||||
import { render } from '../../utils/testing';
|
||||
import React from 'react';
|
||||
import { act, fireEvent, waitFor } from '@testing-library/react';
|
||||
import { act, fireEvent, waitFor, screen } from '@testing-library/react';
|
||||
import { syntheticsTestSubjects } from '../../../../../common/constants/data_test_subjects';
|
||||
import { apiService } from '../../../../utils/api_service';
|
||||
import * as reduxHooks from 'react-redux';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { fireEvent, waitFor } from '@testing-library/dom';
|
||||
import { fireEvent, waitFor } from '@testing-library/react';
|
||||
import { WaterfallMarkerIcon } from './waterfall_marker_icon';
|
||||
import { TestWrapper } from './waterfall_marker_test_helper';
|
||||
import { render } from '../../../../../utils/testing';
|
||||
|
|
|
@ -6,12 +6,14 @@
|
|||
*/
|
||||
|
||||
import React, { ReactElement, ReactNode } from 'react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { of } from 'rxjs';
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import {
|
||||
render as reactTestLibRender,
|
||||
MatcherFunction,
|
||||
RenderOptions,
|
||||
configure,
|
||||
} from '@testing-library/react';
|
||||
import { Router } from '@kbn/shared-ux-router';
|
||||
import { Route } from '@kbn/shared-ux-router';
|
||||
|
@ -21,8 +23,6 @@ import { createMemoryHistory, History } from 'history';
|
|||
import { CoreStart } from '@kbn/core/public';
|
||||
import { I18nProvider } from '@kbn/i18n-react';
|
||||
import { coreMock } from '@kbn/core/public/mocks';
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import { configure } from '@testing-library/dom';
|
||||
import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common';
|
||||
import { IStorageWrapper } from '@kbn/kibana-utils-plugin/public';
|
||||
import { KibanaContextProvider, KibanaServices } from '@kbn/kibana-react-plugin/public';
|
||||
|
@ -161,7 +161,13 @@ export const mockCore: () => Partial<CoreStart> = () => {
|
|||
exploratoryView: {
|
||||
createExploratoryViewUrl: jest.fn(),
|
||||
getAppDataView: jest.fn(),
|
||||
ExploratoryViewEmbeddable: () => <div>Embeddable exploratory view</div>,
|
||||
ExploratoryViewEmbeddable: () => (
|
||||
<div>
|
||||
{i18n.translate('xpack.synthetics.core.div.embeddableExploratoryViewLabel', {
|
||||
defaultMessage: 'Embeddable exploratory view',
|
||||
})}
|
||||
</div>
|
||||
),
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -5,14 +5,13 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { render, fireEvent, screen, waitFor } from '@testing-library/react';
|
||||
import { render, fireEvent, screen, waitFor, within } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import moment from 'moment-timezone';
|
||||
import { TransformListRow } from '../../../../common';
|
||||
import { ExpandedRow } from './expanded_row';
|
||||
|
||||
import transformListRow from '../../../../common/__mocks__/transform_list_row.json';
|
||||
import { within } from '@testing-library/dom';
|
||||
|
||||
jest.mock('../../../../../shared_imports');
|
||||
jest.mock('../../../../app_dependencies');
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
import React from 'react';
|
||||
import { renderHook } from '@testing-library/react-hooks/dom';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import { useGetQueryDelaySettings } from './use_get_query_delay_settings';
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import { RuleStatus } from '../../types';
|
|||
import { useKibana } from '../../common/lib/kibana';
|
||||
import { IToasts } from '@kbn/core-notifications-browser';
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
|
||||
jest.mock('../../common/lib/kibana');
|
||||
jest.mock('../lib/rule_api/aggregate_kuery_filter', () => ({
|
||||
|
|
|
@ -15,7 +15,7 @@ import { RuleStatus } from '../../types';
|
|||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import { useKibana } from '../../common/lib/kibana';
|
||||
import { IToasts } from '@kbn/core-notifications-browser';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
|
||||
jest.mock('../../common/lib/kibana');
|
||||
jest.mock('../lib/rule_api/rules_kuery_filter', () => ({
|
||||
|
|
|
@ -10,7 +10,7 @@ import { useLoadTagsQuery } from './use_load_tags_query';
|
|||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import { useKibana } from '../../common/lib/kibana';
|
||||
import { IToasts } from '@kbn/core-notifications-browser';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
|
||||
const MOCK_TAGS = ['a', 'b', 'c'];
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
import React from 'react';
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import { act, renderHook } from '@testing-library/react-hooks/dom';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
import { useUpdateRuleSettings } from './use_update_rules_settings';
|
||||
|
||||
const mockAddDanger = jest.fn();
|
||||
|
|
|
@ -9,7 +9,7 @@ import React, { lazy } from 'react';
|
|||
import { ConnectorForm } from './connector_form';
|
||||
import { actionTypeRegistryMock } from '../../action_type_registry.mock';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
import { act } from '@testing-library/react';
|
||||
import { AppMockRenderer, createAppMockRenderer } from '../test_utils';
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import { coreMock } from '@kbn/core/public/mocks';
|
|||
import { FormTestProvider } from '../../components/test_utils';
|
||||
import { ConnectorFormFields } from './connector_form_fields';
|
||||
import { actionTypeRegistryMock } from '../../action_type_registry.mock';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
import { AppMockRenderer, createAppMockRenderer } from '../test_utils';
|
||||
|
||||
describe('ConnectorFormFields', () => {
|
||||
|
|
|
@ -9,8 +9,7 @@ import React, { lazy } from 'react';
|
|||
|
||||
import { actionTypeRegistryMock } from '../../../action_type_registry.mock';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { act } from '@testing-library/react';
|
||||
import { waitFor, act } from '@testing-library/react';
|
||||
import CreateConnectorFlyout from '.';
|
||||
import { betaBadgeProps } from '../beta_badge_props';
|
||||
import { AppMockRenderer, createAppMockRenderer } from '../../test_utils';
|
||||
|
|
|
@ -9,8 +9,7 @@ import React, { lazy } from 'react';
|
|||
|
||||
import { actionTypeRegistryMock } from '../../../action_type_registry.mock';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { act } from '@testing-library/react';
|
||||
import { waitFor, act } from '@testing-library/react';
|
||||
import EditConnectorFlyout from '.';
|
||||
import { ActionConnector, EditConnectorTabs, GenericValidationResult } from '../../../../types';
|
||||
import { betaBadgeProps } from '../beta_badge_props';
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import { renderHook } from '@testing-library/react-hooks';
|
||||
import * as api from './apis/bulk_get_cases';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
import { useKibana } from '../../../../common/lib/kibana';
|
||||
import { useBulkGetCases } from './use_bulk_get_cases';
|
||||
import { AppMockRenderer, createAppMockRenderer } from '../../test_utils';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { renderHook } from '@testing-library/react-hooks';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
import { MaintenanceWindowStatus } from '@kbn/alerting-plugin/common';
|
||||
import * as api from './apis/bulk_get_maintenance_windows';
|
||||
import { coreMock } from '@kbn/core/public/mocks';
|
||||
|
|
|
@ -10,7 +10,7 @@ import { UptimeDatePicker } from './uptime_date_picker';
|
|||
import { startPlugins } from '../../lib/__mocks__/uptime_plugin_start_mock';
|
||||
import { createMemoryHistory } from 'history';
|
||||
import { render } from '../../lib/helper/rtl_helpers';
|
||||
import { fireEvent } from '@testing-library/dom';
|
||||
import { fireEvent } from '@testing-library/react';
|
||||
|
||||
describe('UptimeDatePicker component', () => {
|
||||
jest.setTimeout(10_000);
|
||||
|
|
|
@ -11,7 +11,7 @@ import { renderLegendItem } from '../../step_detail/waterfall/waterfall_chart_wr
|
|||
import { render } from '../../../../../lib/helper/rtl_helpers';
|
||||
|
||||
import 'jest-canvas-mock';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
|
||||
describe('waterfall', () => {
|
||||
it('sets the correct height in case of full height', () => {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { fireEvent, waitFor } from '@testing-library/dom';
|
||||
import { fireEvent, waitFor } from '@testing-library/react';
|
||||
import { render } from '../../../../../lib/helper/rtl_helpers';
|
||||
import { WaterfallMarkerIcon } from './waterfall_marker_icon';
|
||||
import { TestWrapper } from './waterfall_marker_test_helper';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { screen } from '@testing-library/dom';
|
||||
import { screen } from '@testing-library/react';
|
||||
import {
|
||||
AlertMonitorStatusComponent,
|
||||
AlertMonitorStatusProps,
|
||||
|
|
|
@ -7,8 +7,7 @@
|
|||
|
||||
import React from 'react';
|
||||
import { DefineAlertConnectors } from './define_connectors';
|
||||
import { screen } from '@testing-library/react';
|
||||
import { fireEvent } from '@testing-library/dom';
|
||||
import { screen, fireEvent } from '@testing-library/react';
|
||||
import { ENABLE_STATUS_ALERT } from './translations';
|
||||
import { render } from '../../../../lib/helper/rtl_helpers';
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import React from 'react';
|
||||
import { EnableMonitorAlert } from './enable_alert';
|
||||
import { fireEvent } from '@testing-library/dom';
|
||||
import { fireEvent } from '@testing-library/react';
|
||||
|
||||
import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../../../common/constants';
|
||||
import { makePing } from '../../../../../../common/runtime_types/ping';
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import React from 'react';
|
||||
import ReactRouterDom from 'react-router-dom';
|
||||
import { Route } from '@kbn/shared-ux-router';
|
||||
import { fireEvent, screen } from '@testing-library/dom';
|
||||
import { fireEvent, screen } from '@testing-library/react';
|
||||
import { renderHook, act as hooksAct } from '@testing-library/react-hooks';
|
||||
import { createMemoryHistory } from 'history';
|
||||
import { EuiButtonIcon } from '@elastic/eui';
|
||||
|
|
|
@ -12,6 +12,7 @@ import {
|
|||
render as reactTestLibRender,
|
||||
MatcherFunction,
|
||||
RenderOptions,
|
||||
configure,
|
||||
} from '@testing-library/react';
|
||||
import { Router } from '@kbn/shared-ux-router';
|
||||
import { Route } from '@kbn/shared-ux-router';
|
||||
|
@ -21,8 +22,6 @@ import { createMemoryHistory, History } from 'history';
|
|||
import { CoreStart } from '@kbn/core/public';
|
||||
import { I18nProvider } from '@kbn/i18n-react';
|
||||
import { coreMock } from '@kbn/core/public/mocks';
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import { configure } from '@testing-library/dom';
|
||||
import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common';
|
||||
import { IStorageWrapper } from '@kbn/kibana-utils-plugin/public';
|
||||
import { KibanaContextProvider, KibanaServices } from '@kbn/kibana-react-plugin/public';
|
||||
|
|
|
@ -8,7 +8,7 @@ import React from 'react';
|
|||
|
||||
import { isValidCertVal, SettingsPage } from './settings';
|
||||
import { render } from '../lib/helper/rtl_helpers';
|
||||
import { fireEvent, waitFor } from '@testing-library/dom';
|
||||
import { fireEvent, waitFor } from '@testing-library/react';
|
||||
import * as alertApi from '../state/api/alerts';
|
||||
import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../common/constants';
|
||||
|
||||
|
|
|
@ -8251,7 +8251,7 @@
|
|||
resolved "https://registry.yarnpkg.com/@testim/chrome-version/-/chrome-version-1.1.3.tgz#fbb68696899d7b8c1b9b891eded9c04fe2cd5529"
|
||||
integrity sha512-g697J3WxV/Zytemz8aTuKjTGYtta9+02kva3C1xc7KXB8GdbfE1akGJIsZLyY/FSh2QrnE+fiB7vmWU3XNcb6A==
|
||||
|
||||
"@testing-library/dom@^8.0.0", "@testing-library/dom@^8.19.0":
|
||||
"@testing-library/dom@^8.0.0":
|
||||
version "8.19.0"
|
||||
resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-8.19.0.tgz#bd3f83c217ebac16694329e413d9ad5fdcfd785f"
|
||||
integrity sha512-6YWYPPpxG3e/xOo6HIWwB/58HukkwIVTOaZ0VwdMVjhRUX/01E4FtQbck9GazOOj7MXHc5RBzMrU86iBJHbI+A==
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue