mirror of
https://github.com/grafana/grafana.git
synced 2024-12-25 08:21:46 -06:00
Chore: Move structured-clone
polyfill to setupTests (#95406)
* Add structured-clone polyfill to setupTests * Remove manual structured-clone imports
This commit is contained in:
parent
55afbdc6be
commit
03715f062b
@ -1,4 +1,3 @@
|
||||
import 'core-js/stable/structured-clone';
|
||||
import { clickSelectOption } from 'test/helpers/selectOptionInTest';
|
||||
import { render, screen, userEvent } from 'test/test-utils';
|
||||
import { byLabelText, byRole, byTestId, byText } from 'testing-library-selector';
|
||||
|
@ -12,7 +12,6 @@ import { grantUserPermissions } from 'app/features/alerting/unified/mocks';
|
||||
import { setupDataSources } from 'app/features/alerting/unified/testSetup/datasources';
|
||||
import { AccessControlAction } from 'app/types';
|
||||
|
||||
import 'core-js/stable/structured-clone';
|
||||
import ContactPoints from './components/contact-points/ContactPoints';
|
||||
import EditContactPoint from './components/contact-points/EditContactPoint';
|
||||
import NewReceiverView from './components/receivers/NewReceiverView';
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'core-js/stable/structured-clone';
|
||||
import { Routes, Route } from 'react-router-dom-v5-compat';
|
||||
import { render, screen } from 'test/test-utils';
|
||||
import { byLabelText, byPlaceholderText, byRole, byTestId } from 'testing-library-selector';
|
||||
|
@ -19,8 +19,6 @@ import { renderWithProvider } from '../../contact-points/ContactPoints.test';
|
||||
|
||||
import { GrafanaReceiverForm } from './GrafanaReceiverForm';
|
||||
|
||||
import 'core-js/stable/structured-clone';
|
||||
|
||||
setupMswServer();
|
||||
|
||||
const ui = {
|
||||
|
@ -3,8 +3,6 @@ import { FormProvider, useForm } from 'react-hook-form';
|
||||
import { screen, render, within } from 'test/test-utils';
|
||||
import { byRole, byTestId } from 'testing-library-selector';
|
||||
|
||||
import 'core-js/stable/structured-clone';
|
||||
|
||||
import { DashboardSearchItemType } from '../../../../search/types';
|
||||
import { mockDashboardApi, setupMswServer } from '../../mockApi';
|
||||
import { mockDashboardDto, mockDashboardSearchItem } from '../../mocks';
|
||||
|
@ -3,8 +3,6 @@ import { Props } from 'react-virtualized-auto-sizer';
|
||||
import { render } from 'test/test-utils';
|
||||
import { byRole } from 'testing-library-selector';
|
||||
|
||||
import 'core-js/stable/structured-clone';
|
||||
|
||||
import { DashboardSearchItemType } from '../../../../search/types';
|
||||
import { mockDashboardApi, setupMswServer } from '../../mockApi';
|
||||
import { mockDashboardDto, mockDashboardSearchItem } from '../../mocks';
|
||||
|
@ -3,7 +3,6 @@ import { byRole, byTestId, byText } from 'testing-library-selector';
|
||||
|
||||
import { AccessControlAction } from 'app/types/accessControl';
|
||||
|
||||
import 'core-js/stable/structured-clone';
|
||||
import { MatcherOperator } from '../../../../../../plugins/datasource/alertmanager/types';
|
||||
import { Labels } from '../../../../../../types/unified-alerting-dto';
|
||||
import { mockApi, setupMswServer } from '../../../mockApi';
|
||||
|
@ -10,8 +10,6 @@ import {
|
||||
unquoteRouteMatchers,
|
||||
} from './notification-policies';
|
||||
|
||||
import 'core-js/stable/structured-clone';
|
||||
|
||||
const CATCH_ALL_ROUTE: Route = {
|
||||
receiver: 'ALL',
|
||||
object_matchers: [],
|
||||
|
@ -1,5 +1,3 @@
|
||||
import 'core-js/stable/structured-clone';
|
||||
|
||||
import { NotifierDTO } from 'app/types';
|
||||
|
||||
import { Receiver } from '../../../../plugins/datasource/alertmanager/types';
|
||||
|
@ -1,3 +1,5 @@
|
||||
// `structuredClone` is not yet in jsdom https://github.com/jsdom/jsdom/issues/3363
|
||||
import 'core-js/stable/structured-clone';
|
||||
import 'whatwg-fetch';
|
||||
import '@testing-library/jest-dom';
|
||||
import { configure } from '@testing-library/react';
|
||||
|
Loading…
Reference in New Issue
Block a user