Skip to content

Commit

Permalink
Fix kfetch mock in saved object jest tests (elastic#34815) (elastic#3…
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecote authored Apr 9, 2019
1 parent c241b70 commit 6ee5997
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {};
Expand Down

0 comments on commit 6ee5997

Please sign in to comment.