From 58a44f04b023ca07701cb5b4e29fe57a7a0ee68d Mon Sep 17 00:00:00 2001 From: stephmilovic Date: Fri, 10 Apr 2020 07:49:06 -0600 Subject: [PATCH] fix use push to service test --- .../case/components/use_push_to_service/index.test.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/x-pack/legacy/plugins/siem/public/pages/case/components/use_push_to_service/index.test.tsx b/x-pack/legacy/plugins/siem/public/pages/case/components/use_push_to_service/index.test.tsx index 1173a552d7c79..77215e2318ded 100644 --- a/x-pack/legacy/plugins/siem/public/pages/case/components/use_push_to_service/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/case/components/use_push_to_service/index.test.tsx @@ -4,19 +4,19 @@ * you may not use this file except in compliance with the Elastic License. */ /* eslint-disable react/display-name */ +import React from 'react'; import { renderHook, act } from '@testing-library/react-hooks'; import { usePushToService, ReturnUsePushToService, UsePushToService } from './'; import { TestProviders } from '../../../../mock'; -import React from 'react'; -import * as api from '../../../../containers/case/configure/api'; import { usePostPushToService } from '../../../../containers/case/use_post_push_to_service'; import { ClosureType } from '../../../../../../../../plugins/case/common/api/cases'; import * as i18n from './translations'; -jest.mock('../../../../containers/case/use_post_push_to_service'); -jest.mock('../../../../containers/case/configure/api'); import { useGetActionLicense } from '../../../../containers/case/use_get_action_license'; import { getKibanaConfigError, getLicenseError } from './helpers'; +import * as api from '../../../../containers/case/configure/api'; jest.mock('../../../../containers/case/use_get_action_license'); +jest.mock('../../../../containers/case/use_post_push_to_service'); +jest.mock('../../../../containers/case/configure/api'); describe('usePushToService', () => { const caseId = '12345'; @@ -40,7 +40,7 @@ describe('usePushToService', () => { updatedBy: {}, version: 'string', }; - const getConfigureMock = api.getCaseConfigure as jest.Mock; + const getConfigureMock = jest.spyOn(api, 'getCaseConfigure'); const actionLicense = { id: '.servicenow', name: 'ServiceNow',