Fix kfetch mock in saved object jest tests (#34815)
This commit is contained in:
parent
8bb2c8b3ab
commit
d0b4e3de8f
|
@ -24,7 +24,7 @@ import { ObjectsTable, INCLUDED_TYPES } from '../objects_table';
|
||||||
import { Flyout } from '../components/flyout/';
|
import { Flyout } from '../components/flyout/';
|
||||||
import { Relationships } from '../components/relationships/';
|
import { Relationships } from '../components/relationships/';
|
||||||
|
|
||||||
jest.mock('ui/kfetch', () => jest.fn());
|
jest.mock('ui/kfetch', () => ({ kfetch: jest.fn() }));
|
||||||
|
|
||||||
jest.mock('../components/header', () => ({
|
jest.mock('../components/header', () => ({
|
||||||
Header: () => 'Header',
|
Header: () => 'Header',
|
||||||
|
|
|
@ -22,7 +22,7 @@ import { shallowWithIntl } from 'test_utils/enzyme_helpers';
|
||||||
|
|
||||||
import { Flyout } from '../flyout';
|
import { Flyout } from '../flyout';
|
||||||
|
|
||||||
jest.mock('ui/kfetch', () => jest.fn());
|
jest.mock('ui/kfetch', () => ({ kfetch: jest.fn() }));
|
||||||
|
|
||||||
jest.mock('ui/errors', () => ({
|
jest.mock('ui/errors', () => ({
|
||||||
SavedObjectNotFound: class SavedObjectNotFound extends Error {
|
SavedObjectNotFound: class SavedObjectNotFound extends Error {
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { shallowWithIntl } from 'test_utils/enzyme_helpers';
|
import { shallowWithIntl } from 'test_utils/enzyme_helpers';
|
||||||
|
|
||||||
jest.mock('ui/kfetch', () => jest.fn());
|
jest.mock('ui/kfetch', () => ({ kfetch: jest.fn() }));
|
||||||
|
|
||||||
jest.mock('ui/errors', () => ({
|
jest.mock('ui/errors', () => ({
|
||||||
SavedObjectNotFound: class SavedObjectNotFound extends Error {
|
SavedObjectNotFound: class SavedObjectNotFound extends Error {
|
||||||
|
|
|
@ -22,7 +22,7 @@ import { shallowWithIntl, mountWithIntl } from 'test_utils/enzyme_helpers';
|
||||||
import { findTestSubject } from '@elastic/eui/lib/test';
|
import { findTestSubject } from '@elastic/eui/lib/test';
|
||||||
import { keyCodes } from '@elastic/eui/lib/services';
|
import { keyCodes } from '@elastic/eui/lib/services';
|
||||||
|
|
||||||
jest.mock('ui/kfetch', () => jest.fn());
|
jest.mock('ui/kfetch', () => ({ kfetch: jest.fn() }));
|
||||||
|
|
||||||
jest.mock('ui/errors', () => ({
|
jest.mock('ui/errors', () => ({
|
||||||
SavedObjectNotFound: class SavedObjectNotFound extends Error {
|
SavedObjectNotFound: class SavedObjectNotFound extends Error {
|
||||||
|
|
|
@ -19,9 +19,7 @@
|
||||||
|
|
||||||
import { resolveImportErrors } from '../resolve_import_errors';
|
import { resolveImportErrors } from '../resolve_import_errors';
|
||||||
|
|
||||||
jest.mock('ui/kfetch', () => ({
|
jest.mock('ui/kfetch', () => ({ kfetch: jest.fn() }));
|
||||||
kfetch: jest.fn(),
|
|
||||||
}));
|
|
||||||
|
|
||||||
function getFormData(form) {
|
function getFormData(form) {
|
||||||
const formData = {};
|
const formData = {};
|
||||||
|
|
Loading…
Reference in a new issue