]> source.dussan.org Git - sonarqube.git/commitdiff
drop mocking of react-dom
authorStas Vilchik <stas.vilchik@sonarsource.com>
Mon, 2 Jul 2018 12:47:39 +0000 (14:47 +0200)
committersonartech <sonartech@sonarsource.com>
Wed, 4 Jul 2018 07:31:06 +0000 (09:31 +0200)
server/sonar-web/src/main/js/__mocks__/react-dom.ts [deleted file]
server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/ScannerContext-test.tsx
server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/Stacktrace-test.tsx
server/sonar-web/src/main/js/apps/organizations/components/forms/__tests__/AddMemberForm-test.js
server/sonar-web/src/main/js/apps/organizations/components/forms/__tests__/ManageMemberGroupsForm-test.js
server/sonar-web/src/main/js/apps/projectsManagement/__tests__/BulkApplyTemplateModal-test.tsx

diff --git a/server/sonar-web/src/main/js/__mocks__/react-dom.ts b/server/sonar-web/src/main/js/__mocks__/react-dom.ts
deleted file mode 100644 (file)
index 8ce90f6..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2018 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-const ReactDOM = require.requireActual('react-dom');
-
-//FIXME To be dropped when https://github.com/airbnb/enzyme/issues/1150 is resolved
-module.exports = {
-  ...ReactDOM,
-  createPortal: (children: React.ReactNode) => children
-};
index cb3de25e5ef7d8e71cb29e3b234ce9406de89fe4..e2fb32157e2e837cb34c065ebad1ca6b1a901a7b 100644 (file)
@@ -23,8 +23,6 @@ import { shallow } from 'enzyme';
 import ScannerContext from '../ScannerContext';
 import { click } from '../../../../helpers/testUtils';
 
-jest.mock('react-dom');
-
 jest.mock('../../../../api/ce', () => ({
   getTask: jest.fn(() => Promise.resolve({ scannerContext: 'context' }))
 }));
index 0a5826e47506590cc30c0edff4bde3bac562d9b6..96ccc7077d0ca3b361bd5d4da7ac3dab0e75effc 100644 (file)
@@ -23,8 +23,6 @@ import { shallow } from 'enzyme';
 import Stacktrace from '../Stacktrace';
 import { click } from '../../../../helpers/testUtils';
 
-jest.mock('react-dom');
-
 jest.mock('../../../../api/ce', () => ({
   getTask: jest.fn(() => Promise.resolve({ errorStacktrace: 'stacktrace' }))
 }));
index b2a32edcbef43a0d10be45f6cbdc36055bf1e30c..308ff1f7d5e739ec09295a4faf1f3468ce72275e 100644 (file)
@@ -22,8 +22,6 @@ import { shallow } from 'enzyme';
 import { click } from '../../../../../helpers/testUtils';
 import AddMemberForm from '../AddMemberForm';
 
-jest.mock('react-dom');
-
 const memberLogins = ['admin'];
 
 it('should render and open the modal', () => {
index c2d30153c74b7f2d2f90ced1e9c888d95fa952e2..579a42f96ef00f2aa236dca5735f31663e6ab754 100644 (file)
@@ -22,8 +22,6 @@ import { shallow } from 'enzyme';
 import { click, mockEvent } from '../../../../../helpers/testUtils';
 import ManageMemberGroupsForm from '../ManageMemberGroupsForm';
 
-jest.mock('react-dom');
-
 const member = { login: 'admin', name: 'Admin Istrator', avatar: '', groupCount: 3 };
 const organization = { name: 'MyOrg', key: 'myorg' };
 const organizationGroups = [
index 4667b3ef251926cef9c85a5dacc0af5151a7cd84..d64eb47f7200b64a938c173d1722359cd35fc183 100644 (file)
@@ -24,8 +24,6 @@ import BulkApplyTemplateModal, { Props } from '../BulkApplyTemplateModal';
 import { click, waitAndUpdate } from '../../../helpers/testUtils';
 import { parseDate } from '../../../helpers/dates';
 
-jest.mock('react-dom');
-
 jest.mock('../../../api/permissions', () => ({
   bulkApplyTemplate: jest.fn(() => Promise.resolve()),
   getPermissionTemplates: jest.fn(() => Promise.resolve({ permissionTemplates: [] }))