From 99463bb6ab73cc0db72df7b445e5ab669e55380e Mon Sep 17 00:00:00 2001 From: Jason Stoltzfus Date: Wed, 11 Nov 2020 08:50:25 -0500 Subject: [PATCH] No portal --- .../log_retention_confirmation_modal.test.tsx | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/settings/log_retention/log_retention_confirmation_modal.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/settings/log_retention/log_retention_confirmation_modal.test.tsx index 68ed6a9ff9559..5ff75966b3585 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/settings/log_retention/log_retention_confirmation_modal.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/settings/log_retention/log_retention_confirmation_modal.test.tsx @@ -8,7 +8,6 @@ import '../../../../__mocks__/kea.mock'; import { setMockActions, setMockValues } from '../../../../__mocks__'; import React from 'react'; -import ReactDOM from 'react-dom'; import { shallow } from 'enzyme'; import { LogRetentionConfirmationModal } from './log_retention_confirmation_modal'; @@ -16,16 +15,6 @@ import { ELogRetentionOptions } from './types'; import { GenericConfirmationModal } from './generic_confirmation_modal'; describe('', () => { - beforeAll(() => { - // LogRetentionConfirmationModal contains EuiModals, which utilize React Portals, - // so we must mock `createPortal` to get the rendered element directly, - // instead of letting it be placed normally elsewhere in DOM (outside of jest's domain) - // @ts-ignore - ReactDOM.createPortal = jest.fn((element) => { - return element; - }); - }); - const actions = { closeModals: jest.fn(), saveLogRetention: jest.fn(), @@ -57,12 +46,6 @@ describe('', () => { setMockValues(values); }); - afterEach(() => { - // Remove the jest mock on createPortal - // @ts-ignore - ReactDOM.createPortal.mockClear(); - }); - it('renders nothing by default', () => { const logRetentionPanel = shallow(); expect(logRetentionPanel.isEmptyRender()).toBe(true);