mocking canvas (#107147)

This commit is contained in:
Marta Bondyra 2021-07-30 09:25:56 +02:00 committed by GitHub
parent f0797759f4
commit 6da99f33e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 2 deletions

View file

@ -6,6 +6,7 @@
*/
import { ReactWrapper, ShallowWrapper } from 'enzyme';
import 'jest-canvas-mock';
import React, { ChangeEvent, MouseEvent, ReactElement } from 'react';
import { act } from 'react-dom/test-utils';
import {

View file

@ -10,6 +10,7 @@ import { ReactWrapper, ShallowWrapper } from 'enzyme';
import { act } from 'react-dom/test-utils';
import { EuiComboBox } from '@elastic/eui';
import { mountWithIntl as mount } from '@kbn/test/jest';
import 'jest-canvas-mock';
import type { IUiSettingsClient, SavedObjectsClientContract, HttpSetup } from 'kibana/public';
import { IStorageWrapper } from 'src/plugins/kibana_utils/public';
import type { DataPublicPluginStart } from 'src/plugins/data/public';

View file

@ -5,6 +5,8 @@
* 2.0.
*/
import React from 'react';
import 'jest-canvas-mock';
import { IStorageWrapper } from 'src/plugins/kibana_utils/public';
import { getIndexPatternDatasource, IndexPatternColumn } from './indexpattern';
import { DatasourcePublicAPI, Operation, Datasource, FramePublicAPI } from '../types';
@ -18,8 +20,6 @@ import { operationDefinitionMap, getErrorMessages } from './operations';
import { createMockedFullReference } from './operations/mocks';
import { indexPatternFieldEditorPluginMock } from 'src/plugins/index_pattern_field_editor/public/mocks';
import { uiActionsPluginMock } from '../../../../../src/plugins/ui_actions/public/mocks';
import React from 'react';
jest.mock('./loader');
jest.mock('../id_generator');
jest.mock('./operations');

View file

@ -8,6 +8,7 @@
import { DatasourceSuggestion } from '../types';
import { generateId } from '../id_generator';
import type { IndexPatternPrivateState } from './types';
import 'jest-canvas-mock';
import {
getDatasourceSuggestionsForField,
getDatasourceSuggestionsFromCurrentState,