mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Remove explicit imports of whatwg-fetch
from individual test files
This commit is contained in:
parent
389250afe0
commit
a5c75c5ffb
@ -1,7 +1,6 @@
|
||||
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/metric_find_query.test.ts
|
||||
import { Observable, of } from 'rxjs';
|
||||
|
||||
import 'whatwg-fetch'; // fetch polyfill needed backendSrv
|
||||
import { DataSourceInstanceSettings, TimeRange, toUtc } from '@grafana/data';
|
||||
import { BackendDataSourceResponse, BackendSrvRequest, FetchResponse, TemplateSrv } from '@grafana/runtime';
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch'; // fetch polyfill
|
||||
import { fireEvent, render as rtlRender, screen } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { HttpResponse, http } from 'msw';
|
||||
|
@ -1,5 +1,3 @@
|
||||
import 'whatwg-fetch'; // fetch polyfill needed for Headers
|
||||
|
||||
import { of } from 'rxjs';
|
||||
|
||||
import { BackendSrvRequest, FetchResponse } from '@grafana/runtime';
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch'; // fetch polyfill needed for PhantomJs rendering
|
||||
import { Observable, of, lastValueFrom } from 'rxjs';
|
||||
import { fromFetch } from 'rxjs/fetch';
|
||||
import { delay } from 'rxjs/operators';
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch'; // fetch polyfill needed for PhantomJs rendering
|
||||
import {
|
||||
isContentTypeApplicationJson,
|
||||
parseBody,
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch';
|
||||
import { render, waitFor, waitForElementToBeRemoved, within } from '@testing-library/react';
|
||||
import { setupServer } from 'msw/node';
|
||||
import React from 'react';
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch';
|
||||
import { screen, waitFor, waitForElementToBeRemoved, within } from '@testing-library/react';
|
||||
import userEvent, { PointerEventsCheckLevel } from '@testing-library/user-event';
|
||||
import React from 'react';
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch';
|
||||
import { screen, waitFor, waitForElementToBeRemoved, within } from '@testing-library/react';
|
||||
import userEvent, { PointerEventsCheckLevel } from '@testing-library/user-event';
|
||||
import React from 'react';
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch';
|
||||
import { render, screen, waitFor } from '@testing-library/react';
|
||||
import { setupServer } from 'msw/node';
|
||||
import React from 'react';
|
||||
|
@ -1,5 +1,3 @@
|
||||
// bit of setup to mock HTTP request responses
|
||||
import 'whatwg-fetch';
|
||||
import { http, HttpResponse } from 'msw';
|
||||
import { setupServer } from 'msw/node';
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch';
|
||||
import { http, HttpResponse } from 'msw';
|
||||
import { SetupServer } from 'msw/node';
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch';
|
||||
import { http, HttpResponse } from 'msw';
|
||||
import { SetupServer } from 'msw/lib/node';
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch';
|
||||
import { http, HttpResponse } from 'msw';
|
||||
import { SetupServer } from 'msw/lib/node';
|
||||
|
||||
|
@ -6,8 +6,6 @@ import { TestProvider } from 'test/helpers/TestProvider';
|
||||
|
||||
import { PayloadEditor, RESET_TO_DEFAULT } from './PayloadEditor';
|
||||
|
||||
import 'whatwg-fetch';
|
||||
|
||||
const DEFAULT_PAYLOAD = `[
|
||||
{
|
||||
"annotations": {
|
||||
|
@ -10,7 +10,6 @@ import { setBackendSrv } from '@grafana/runtime';
|
||||
import { backendSrv } from 'app/core/services/backend_srv';
|
||||
import { configureStore } from 'app/store/configureStore';
|
||||
|
||||
import 'whatwg-fetch';
|
||||
import { TemplatePreviewResponse } from '../../api/templateApi';
|
||||
import {
|
||||
mockPreviewTemplateResponse,
|
||||
|
@ -17,8 +17,6 @@ import { RuleFormValues } from '../../types/rule-form';
|
||||
import { Annotation } from '../../utils/constants';
|
||||
import { getDefaultFormValues } from '../../utils/rule-form';
|
||||
|
||||
import 'whatwg-fetch';
|
||||
|
||||
import AnnotationsStep from './AnnotationsStep';
|
||||
|
||||
// To get anything displayed inside the Autosize component we need to mock it
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch';
|
||||
import { render, screen, waitFor, waitForElementToBeRemoved } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import React from 'react';
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch';
|
||||
import { http, HttpResponse } from 'msw';
|
||||
import { SetupServer, setupServer } from 'msw/node';
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch';
|
||||
import { render, screen, waitFor } from '@testing-library/react';
|
||||
import { http, HttpResponse } from 'msw';
|
||||
import { setupServer } from 'msw/node';
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import React from 'react';
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch';
|
||||
import { render, waitFor } from '@testing-library/react';
|
||||
import { http, HttpResponse } from 'msw';
|
||||
import { setupServer } from 'msw/node';
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch';
|
||||
import { renderHook, waitFor } from '@testing-library/react';
|
||||
import { createBrowserHistory } from 'history';
|
||||
import React, { PropsWithChildren } from 'react';
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch';
|
||||
import { renderHook, waitFor } from '@testing-library/react';
|
||||
import { http, HttpResponse } from 'msw';
|
||||
import { SetupServer, setupServer } from 'msw/node';
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch';
|
||||
import { uniqueId } from 'lodash';
|
||||
import { http, HttpResponse } from 'msw';
|
||||
import { setupServer, SetupServer } from 'msw/node';
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch';
|
||||
import { http, HttpResponse } from 'msw';
|
||||
import { SetupServer } from 'msw/node';
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch';
|
||||
import { http, HttpResponse } from 'msw';
|
||||
import { SetupServer } from 'msw/node';
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch';
|
||||
import { http, HttpResponse } from 'msw';
|
||||
import { SetupServer } from 'msw/lib/node';
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch';
|
||||
import { http, HttpResponse } from 'msw';
|
||||
import { SetupServer } from 'msw/node';
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch';
|
||||
import { http, HttpResponse } from 'msw';
|
||||
import { SetupServer } from 'msw/node';
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch';
|
||||
import { render as rtlRender, screen } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { HttpResponse, http } from 'msw';
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch';
|
||||
import { render as rtlRender, screen } from '@testing-library/react';
|
||||
import { http, HttpResponse } from 'msw';
|
||||
import { SetupServer, setupServer } from 'msw/node';
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch';
|
||||
import { render as rtlRender, screen } from '@testing-library/react';
|
||||
import { http, HttpResponse } from 'msw';
|
||||
import { SetupServer, setupServer } from 'msw/node';
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch';
|
||||
import { act, render } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import React from 'react';
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { merge } from 'lodash';
|
||||
import { http, HttpResponse } from 'msw';
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch';
|
||||
import { advanceTo } from 'jest-date-mock';
|
||||
import { map, of } from 'rxjs';
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch';
|
||||
import { screen, waitFor } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { http, HttpResponse } from 'msw';
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch';
|
||||
import { fireEvent, render, screen, waitFor, waitForElementToBeRemoved } from '@testing-library/react';
|
||||
import { http, HttpResponse } from 'msw';
|
||||
import React from 'react';
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch';
|
||||
import { render, screen, waitFor } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { Provider } from 'react-redux';
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch';
|
||||
import { act, render, screen, waitFor } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import React, { ReactNode } from 'react';
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch';
|
||||
import { render, screen, waitForElementToBeRemoved, within } from '@testing-library/react';
|
||||
import { http, HttpResponse } from 'msw';
|
||||
import { setupServer } from 'msw/node';
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch'; // fetch polyfill
|
||||
import { render as rtlRender, screen } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import React from 'react';
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch'; // fetch polyfill
|
||||
import { render as rtlRender, screen } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { TestProvider } from 'test/helpers/TestProvider';
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch';
|
||||
import { fireEvent, render, screen, waitFor } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { History, Location } from 'history';
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch';
|
||||
import { fireEvent, render, screen, waitFor } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import React from 'react';
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'whatwg-fetch';
|
||||
import { http, HttpResponse } from 'msw';
|
||||
import { setupServer } from 'msw/node';
|
||||
|
||||
|
@ -1,6 +1,3 @@
|
||||
// mock fetch for SystemJS
|
||||
import 'whatwg-fetch';
|
||||
|
||||
import { config } from '@grafana/runtime';
|
||||
|
||||
jest.mock('./cache', () => ({
|
||||
|
Loading…
Reference in New Issue
Block a user