Fix kfetch mock in saved object jest tests (#34815)

This commit is contained in:
Mike Côté 2019-04-09 17:23:50 -04:00 committed by GitHub
parent 8bb2c8b3ab
commit d0b4e3de8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 7 deletions

View file

@ -24,7 +24,7 @@ import { ObjectsTable, INCLUDED_TYPES } from '../objects_table';
import { Flyout } from '../components/flyout/';
import { Relationships } from '../components/relationships/';
jest.mock('ui/kfetch', () => jest.fn());
jest.mock('ui/kfetch', () => ({ kfetch: jest.fn() }));
jest.mock('../components/header', () => ({
Header: () => 'Header',

View file

@ -22,7 +22,7 @@ import { shallowWithIntl } from 'test_utils/enzyme_helpers';
import { Flyout } from '../flyout';
jest.mock('ui/kfetch', () => jest.fn());
jest.mock('ui/kfetch', () => ({ kfetch: jest.fn() }));
jest.mock('ui/errors', () => ({
SavedObjectNotFound: class SavedObjectNotFound extends Error {

View file

@ -20,7 +20,7 @@
import React from 'react';
import { shallowWithIntl } from 'test_utils/enzyme_helpers';
jest.mock('ui/kfetch', () => jest.fn());
jest.mock('ui/kfetch', () => ({ kfetch: jest.fn() }));
jest.mock('ui/errors', () => ({
SavedObjectNotFound: class SavedObjectNotFound extends Error {

View file

@ -22,7 +22,7 @@ import { shallowWithIntl, mountWithIntl } from 'test_utils/enzyme_helpers';
import { findTestSubject } from '@elastic/eui/lib/test';
import { keyCodes } from '@elastic/eui/lib/services';
jest.mock('ui/kfetch', () => jest.fn());
jest.mock('ui/kfetch', () => ({ kfetch: jest.fn() }));
jest.mock('ui/errors', () => ({
SavedObjectNotFound: class SavedObjectNotFound extends Error {

View file

@ -19,9 +19,7 @@
import { resolveImportErrors } from '../resolve_import_errors';
jest.mock('ui/kfetch', () => ({
kfetch: jest.fn(),
}));
jest.mock('ui/kfetch', () => ({ kfetch: jest.fn() }));
function getFormData(form) {
const formData = {};