aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <stas.vilchik@sonarsource.com>2018-07-02 14:47:39 +0200
committersonartech <sonartech@sonarsource.com>2018-07-04 09:31:06 +0200
commit75b52c13c529602ace87503a7b73587f4ae82ed0 (patch)
tree2c3e7054cf957d0bfbd60e4fac6c20d51607de21
parentdf6860806d152b2873e89e659896ae6de146daea (diff)
downloadsonarqube-75b52c13c529602ace87503a7b73587f4ae82ed0.tar.gz
sonarqube-75b52c13c529602ace87503a7b73587f4ae82ed0.zip
drop mocking of react-dom
-rw-r--r--server/sonar-web/src/main/js/__mocks__/react-dom.ts26
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/ScannerContext-test.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/Stacktrace-test.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/organizations/components/forms/__tests__/AddMemberForm-test.js2
-rw-r--r--server/sonar-web/src/main/js/apps/organizations/components/forms/__tests__/ManageMemberGroupsForm-test.js2
-rw-r--r--server/sonar-web/src/main/js/apps/projectsManagement/__tests__/BulkApplyTemplateModal-test.tsx2
6 files changed, 0 insertions, 36 deletions
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
index 8ce90f6e03e..00000000000
--- a/server/sonar-web/src/main/js/__mocks__/react-dom.ts
+++ /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
-};
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/ScannerContext-test.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/ScannerContext-test.tsx
index cb3de25e5ef..e2fb32157e2 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/ScannerContext-test.tsx
+++ b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/ScannerContext-test.tsx
@@ -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' }))
}));
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/Stacktrace-test.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/Stacktrace-test.tsx
index 0a5826e4750..96ccc7077d0 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/Stacktrace-test.tsx
+++ b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/Stacktrace-test.tsx
@@ -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' }))
}));
diff --git a/server/sonar-web/src/main/js/apps/organizations/components/forms/__tests__/AddMemberForm-test.js b/server/sonar-web/src/main/js/apps/organizations/components/forms/__tests__/AddMemberForm-test.js
index b2a32edcbef..308ff1f7d5e 100644
--- a/server/sonar-web/src/main/js/apps/organizations/components/forms/__tests__/AddMemberForm-test.js
+++ b/server/sonar-web/src/main/js/apps/organizations/components/forms/__tests__/AddMemberForm-test.js
@@ -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', () => {
diff --git a/server/sonar-web/src/main/js/apps/organizations/components/forms/__tests__/ManageMemberGroupsForm-test.js b/server/sonar-web/src/main/js/apps/organizations/components/forms/__tests__/ManageMemberGroupsForm-test.js
index c2d30153c74..579a42f96ef 100644
--- a/server/sonar-web/src/main/js/apps/organizations/components/forms/__tests__/ManageMemberGroupsForm-test.js
+++ b/server/sonar-web/src/main/js/apps/organizations/components/forms/__tests__/ManageMemberGroupsForm-test.js
@@ -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 = [
diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/BulkApplyTemplateModal-test.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/BulkApplyTemplateModal-test.tsx
index 4667b3ef251..d64eb47f720 100644
--- a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/BulkApplyTemplateModal-test.tsx
+++ b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/BulkApplyTemplateModal-test.tsx
@@ -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: [] }))