]> source.dussan.org Git - sonarqube.git/commitdiff
Split test utils and mocks, better type mocks
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>
Tue, 5 Feb 2019 08:01:11 +0000 (09:01 +0100)
committersonartech <sonartech@sonarsource.com>
Mon, 11 Feb 2019 08:11:44 +0000 (09:11 +0100)
23 files changed:
server/sonar-web/src/main/js/app/components/nav/global/__tests__/GlobalNavPlus-test.tsx
server/sonar-web/src/main/js/apps/code/components/__tests__/App-test.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/RuleListItem-test.tsx
server/sonar-web/src/main/js/apps/create/organization/__tests__/CreateOrganization-test.tsx
server/sonar-web/src/main/js/apps/create/organization/__tests__/RemoteOrganizationChoose-test.tsx
server/sonar-web/src/main/js/apps/create/project/__tests__/CreateProjectPageSonarCloud-test.tsx
server/sonar-web/src/main/js/apps/create/project/__tests__/OrganizationInput-test.tsx
server/sonar-web/src/main/js/apps/feedback/downgrade/__tests__/DowngradeFeedback-test.tsx
server/sonar-web/src/main/js/apps/organizationMembers/__tests__/ManageMemberGroupsForm-test.tsx
server/sonar-web/src/main/js/apps/organizationMembers/__tests__/RemoveMemberForm-test.tsx
server/sonar-web/src/main/js/apps/overview/meta/__tests__/MetaContainer-test.tsx
server/sonar-web/src/main/js/apps/overview/meta/__tests__/MetaTags-test.tsx
server/sonar-web/src/main/js/apps/quality-profiles/compare/__tests__/ComparisonForm-test.tsx
server/sonar-web/src/main/js/apps/quality-profiles/components/__tests__/ExtendProfileForm-test.tsx
server/sonar-web/src/main/js/apps/quality-profiles/components/__tests__/ProfileActions-test.tsx
server/sonar-web/src/main/js/apps/quality-profiles/components/__tests__/ProfileContainer-test.tsx
server/sonar-web/src/main/js/apps/quality-profiles/details/__tests__/ProfileRules-test.tsx
server/sonar-web/src/main/js/apps/quality-profiles/home/__tests__/EvolutionDeprecated-test.tsx
server/sonar-web/src/main/js/apps/quality-profiles/home/__tests__/ProfilesListHeader-test.tsx
server/sonar-web/src/main/js/apps/quality-profiles/testUtils.ts [deleted file]
server/sonar-web/src/main/js/components/hoc/__tests__/withKeyboardNavigation-test.tsx
server/sonar-web/src/main/js/helpers/testMocks.ts [new file with mode: 0644]
server/sonar-web/src/main/js/helpers/testUtils.ts

index ebf026271f99dfecf7b31773c995803f06e87080..ac376d0a8dc056038dd44bff00d8f7c7a0177764 100644 (file)
@@ -21,7 +21,8 @@ import * as React from 'react';
 import { shallow, ShallowWrapper } from 'enzyme';
 import { GlobalNavPlus } from '../GlobalNavPlus';
 import { isSonarCloud } from '../../../../../helpers/system';
-import { click, mockRouter } from '../../../../../helpers/testUtils';
+import { mockRouter } from '../../../../../helpers/testMocks';
+import { click } from '../../../../../helpers/testUtils';
 
 jest.mock('../../../../../helpers/system', () => ({
   isSonarCloud: jest.fn()
index dcb2a2ddc70e61adac95106713af4e8de8b74854..6fde0de8f0356e279ae1b837636d7ff90562c0d4 100644 (file)
@@ -20,8 +20,9 @@
 import * as React from 'react';
 import { shallow } from 'enzyme';
 import { App } from '../App';
-import { waitAndUpdate, mockRouter } from '../../../../helpers/testUtils';
 import { retrieveComponent } from '../../utils';
+import { mockRouter } from '../../../../helpers/testMocks';
+import { waitAndUpdate } from '../../../../helpers/testUtils';
 
 jest.mock('../../utils', () => ({
   retrieveComponent: jest.fn().mockResolvedValue({
index 2a3638e327f9d14775766f7df4c2a6022712af85..2b220a437538f735191eed33d2ffa4a1ce53bd10 100644 (file)
@@ -20,7 +20,7 @@
 import * as React from 'react';
 import { shallow } from 'enzyme';
 import RuleListItem from '../RuleListItem';
-import { mockEvent } from '../../../../helpers/testUtils';
+import { mockEvent } from '../../../../helpers/testMocks';
 
 const rule: T.Rule = {
   key: 'foo',
@@ -41,7 +41,7 @@ it('should render', () => {
 it('should open rule', () => {
   const onOpen = jest.fn();
   const wrapper = shallowRender({ onOpen });
-  wrapper.find('Link').prop<Function>('onClick')({ ...mockEvent, button: 0 });
+  wrapper.find('Link').prop<Function>('onClick')(mockEvent({ button: 0 }));
   expect(onOpen).toBeCalledWith('foo');
 });
 
index d390eb2c3ece0d563b17ffd9d805d0d1ea0868af..1537668a8fb31f082b81f9be64e31e145a3cb13e 100644 (file)
@@ -22,7 +22,6 @@ import { times } from 'lodash';
 import { Location } from 'history';
 import { shallow } from 'enzyme';
 import { CreateOrganization } from '../CreateOrganization';
-import { mockRouter, waitAndUpdate } from '../../../../helpers/testUtils';
 import {
   getAlmAppInfo,
   getAlmOrganization,
@@ -31,6 +30,8 @@ import {
 import { getSubscriptionPlans } from '../../../../api/billing';
 import { getOrganizations } from '../../../../api/organizations';
 import { get, remove } from '../../../../helpers/storage';
+import { mockRouter } from '../../../../helpers/testMocks';
+import { waitAndUpdate } from '../../../../helpers/testUtils';
 
 jest.mock('../../../../api/billing', () => ({
   getSubscriptionPlans: jest
index e83d7cbd8798b448294465a4c1f326e5a716cd7c..d2e35c6371cb48ba9014e0e21c6858ecb811ea94 100644 (file)
@@ -20,7 +20,8 @@
 import * as React from 'react';
 import { shallow } from 'enzyme';
 import { RemoteOrganizationChoose } from '../RemoteOrganizationChoose';
-import { mockRouter, submit } from '../../../../helpers/testUtils';
+import { mockRouter } from '../../../../helpers/testMocks';
+import { submit } from '../../../../helpers/testUtils';
 
 it('should render', () => {
   expect(shallowRender()).toMatchSnapshot();
index 4b008c90294e6844ff1cb445ff4122eb36d6cca0..9e1a6e66803337a974165618ac2e5ef9acd7344f 100644 (file)
@@ -20,8 +20,9 @@
 import * as React from 'react';
 import { shallow } from 'enzyme';
 import { CreateProjectPageSonarCloud } from '../CreateProjectPageSonarCloud';
-import { waitAndUpdate, mockRouter } from '../../../../helpers/testUtils';
 import { getAlmAppInfo } from '../../../../api/alm-integration';
+import { mockRouter } from '../../../../helpers/testMocks';
+import { waitAndUpdate } from '../../../../helpers/testUtils';
 
 jest.mock('../../../../api/alm-integration', () => ({
   getAlmAppInfo: jest.fn().mockResolvedValue({
index 73cc14fd4291768b427785575f23b7f2cfe3e678..44a1183baed307c83e98bd7e913215e3eb6b7e7e 100644 (file)
@@ -20,7 +20,7 @@
 import * as React from 'react';
 import { shallow } from 'enzyme';
 import { OrganizationInput } from '../OrganizationInput';
-import { mockRouter } from '../../../../helpers/testUtils';
+import { mockRouter } from '../../../../helpers/testMocks';
 
 const organizations = [
   { key: 'foo', name: 'Foo' },
index df1946a7f98b0dbc051067cfdc497629dea05d74..efbaf193e6e534510d9550ea05c3260ea562e056 100644 (file)
@@ -21,7 +21,7 @@ import * as React from 'react';
 import { shallow } from 'enzyme';
 import DowngradeFeedback, { LocationState } from '../DowngradeFeedback';
 import { giveDowngradeFeedback } from '../../../../api/billing';
-import { mockRouter, mockLocation } from '../../../../helpers/testUtils';
+import { mockLocation, mockRouter } from '../../../../helpers/testMocks';
 
 jest.mock('../../../../api/billing', () => ({
   giveDowngradeFeedback: jest.fn()
index 615a785ed43cc536aee77c209cec8fcbf0f2e262..a412a1b679fde0f7a03ab0ea9f255cd36dc69fba 100644 (file)
@@ -19,8 +19,8 @@
  */
 import * as React from 'react';
 import { shallow } from 'enzyme';
-import { mockEvent } from '../../../helpers/testUtils';
 import ManageMemberGroupsForm from '../ManageMemberGroupsForm';
+import { mockEvent } from '../../../helpers/testMocks';
 
 const member = { login: 'admin', name: 'Admin Istrator', avatar: '', groupCount: 3 };
 const organization = { name: 'MyOrg', key: 'myorg' };
@@ -95,7 +95,7 @@ it('should correctly handle the submit event and close the modal', () => {
   const instance = form.instance as ManageMemberGroupsForm;
   instance.onCheck('11', false);
   instance.onCheck('7', true);
-  instance.handleSubmit(mockEvent as any);
+  instance.handleSubmit(mockEvent());
   expect(updateMemberGroups.mock.calls).toMatchSnapshot();
   expect(form.wrapper.state()).toMatchSnapshot();
 });
index d9fdf2ace773da176c5581db1e8f5685c42dfccb..6e7caf42f18b19d8016f99ab986ee0513672db20 100644 (file)
@@ -19,8 +19,8 @@
  */
 import * as React from 'react';
 import { shallow } from 'enzyme';
-import { mockEvent } from '../../../helpers/testUtils';
 import RemoveMemberForm from '../RemoveMemberForm';
+import { mockEvent } from '../../../helpers/testMocks';
 
 const member = { login: 'admin', name: 'Admin Istrator', avatar: '', groupCount: 3 };
 const organization = { key: 'myorg', name: 'MyOrg' };
@@ -39,7 +39,7 @@ it('should render ', () => {
 
 it('should correctly handle user interactions', () => {
   const removeMember = jest.fn();
-  const wrapper = shallow(
+  const wrapper = shallow<RemoveMemberForm>(
     <RemoveMemberForm
       member={member}
       onClose={jest.fn()}
@@ -47,7 +47,7 @@ it('should correctly handle user interactions', () => {
       removeMember={removeMember}
     />
   );
-  (wrapper.instance() as RemoveMemberForm).handleSubmit(mockEvent as any);
+  wrapper.instance().handleSubmit(mockEvent());
   expect(removeMember).toBeCalledWith({
     avatar: '',
     groupCount: 3,
index 75f8c53fe4016148b0ef89a95bfb49c678d23a09..5a1378797e530892d4563ebad58b8116c6c69707 100644 (file)
@@ -25,7 +25,7 @@ import {
   mockCurrentUser,
   mockOrganization,
   mockComponent
-} from '../../../../helpers/testUtils';
+} from '../../../../helpers/testMocks';
 
 it('should render correctly', () => {
   const wrapper = shallowRender();
index e601f09427643980d426591757ef5092a3a4766e..c3b32b28fa5b26820028f54de0756d9ad5ae8a53 100644 (file)
@@ -20,7 +20,7 @@
 import * as React from 'react';
 import { shallow } from 'enzyme';
 import MetaTags from '../MetaTags';
-import { mockComponent } from '../../../../helpers/testUtils';
+import { mockComponent } from '../../../../helpers/testMocks';
 
 const component = mockComponent({
   configuration: {
index 14f71216a8b51e2a155dbb5d3f52611f0904fc9d..514a7acd2d04c18b31e422eb01ac272f3f8d325a 100644 (file)
@@ -20,7 +20,7 @@
 import { shallow } from 'enzyme';
 import * as React from 'react';
 import ComparisonForm from '../ComparisonForm';
-import { mockQualityProfile } from '../../testUtils';
+import { mockQualityProfile } from '../../../../helpers/testMocks';
 
 it('should render Select with right options', () => {
   const profile = mockQualityProfile();
index 167a27703c835679209cb9bb58e30af5465be88d..457e9b503c5ef1e25b20a4890c9ecb242c60c8f2 100644 (file)
@@ -21,7 +21,7 @@ import * as React from 'react';
 import { shallow } from 'enzyme';
 import ExtendProfileForm from '../ExtendProfileForm';
 import { createQualityProfile, changeProfileParent } from '../../../../api/quality-profiles';
-import { mockQualityProfile } from '../../testUtils';
+import { mockQualityProfile } from '../../../../helpers/testMocks';
 import { click } from '../../../../helpers/testUtils';
 
 jest.mock('../../../../api/quality-profiles', () => ({
index 8b4bfdd4c6bfb6025269c7a210eb9a3bbd2f8913..badae2e66a06824bbb97df672a5abbe082904ff1 100644 (file)
@@ -20,8 +20,8 @@
 import * as React from 'react';
 import { shallow } from 'enzyme';
 import { ProfileActions } from '../ProfileActions';
-import { click, waitAndUpdate, mockRouter } from '../../../../helpers/testUtils';
-import { mockQualityProfile } from '../../testUtils';
+import { mockQualityProfile, mockRouter } from '../../../../helpers/testMocks';
+import { click, waitAndUpdate } from '../../../../helpers/testUtils';
 
 const PROFILE = mockQualityProfile({
   activeRuleCount: 68,
index 41fad58dc0667ec17669b5e6c0e292eece6dac34..20aae44fc0b8b631b92e28cc6ba3e89f86c39648 100644 (file)
@@ -24,7 +24,7 @@ import { WithRouterProps } from 'react-router';
 import ProfileContainer from '../ProfileContainer';
 import ProfileNotFound from '../ProfileNotFound';
 import ProfileHeader from '../../details/ProfileHeader';
-import { mockQualityProfile } from '../../testUtils';
+import { mockQualityProfile } from '../../../../helpers/testMocks';
 
 const routerProps = { router: {} } as WithRouterProps;
 
index a273f9a19a8d609a87b54962e95bd396f9c81cd1..f7a9b045ea10bbc9895469840d485fe2471ce550 100644 (file)
@@ -22,8 +22,8 @@ import { shallow } from 'enzyme';
 import ProfileRules from '../ProfileRules';
 import * as apiRules from '../../../../api/rules';
 import * as apiQP from '../../../../api/quality-profiles';
+import { mockQualityProfile } from '../../../../helpers/testMocks';
 import { waitAndUpdate } from '../../../../helpers/testUtils';
-import { mockQualityProfile } from '../../testUtils';
 
 const PROFILE = mockQualityProfile({
   activeRuleCount: 68,
index 3a1a0bb3204db3c00647369d956c95f5878e9361..ae320ce8ef7bc3333be5205aa8a8fc1289d4bb91 100644 (file)
@@ -20,7 +20,7 @@
 import * as React from 'react';
 import { shallow } from 'enzyme';
 import EvolutionDeprecated from '../EvolutionDeprecated';
-import { mockQualityProfile } from '../../testUtils';
+import { mockQualityProfile } from '../../../../helpers/testMocks';
 
 it('should render correctly', () => {
   const wrapper = shallow(
index d7c8aa2b3bfb9c2d1b1d3a40e84764e8cc626340..377d9a8b016ba3cf671ad1e1635a89ce9a8249b0 100644 (file)
@@ -20,7 +20,7 @@
 import * as React from 'react';
 import { shallow } from 'enzyme';
 import { ProfilesListHeader } from '../ProfilesListHeader';
-import { mockRouter } from '../../../../helpers/testUtils';
+import { mockRouter } from '../../../../helpers/testMocks';
 
 it('should render correctly', () => {
   const wrapper = shallowRender();
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/testUtils.ts b/server/sonar-web/src/main/js/apps/quality-profiles/testUtils.ts
deleted file mode 100644 (file)
index d944ce0..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2019 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.
- */
-import { Profile } from './types';
-
-export function mockQualityProfile(overrides = {}): Profile {
-  return {
-    activeDeprecatedRuleCount: 2,
-    activeRuleCount: 10,
-    childrenCount: 0,
-    depth: 1,
-    isBuiltIn: false,
-    isDefault: false,
-    isInherited: false,
-    key: 'key',
-    language: 'js',
-    languageName: 'JavaScript',
-    name: 'name',
-    projectCount: 3,
-    organization: 'foo',
-    ...overrides
-  };
-}
index 1c863aedd7543797afca765c6232b2c02f6e4a13..ffab89a8596b7a4268edc7e55aac961927fc01f5 100644 (file)
@@ -20,7 +20,8 @@
 import * as React from 'react';
 import { mount, shallow } from 'enzyme';
 import withKeyboardNavigation, { WithKeyboardNavigationProps } from '../withKeyboardNavigation';
-import { mockComponent, keydown, KEYCODE_MAP } from '../../../helpers/testUtils';
+import { mockComponent } from '../../../helpers/testMocks';
+import { keydown, KEYCODE_MAP } from '../../../helpers/testUtils';
 
 class X extends React.Component<{
   components?: T.ComponentMeasure[];
diff --git a/server/sonar-web/src/main/js/helpers/testMocks.ts b/server/sonar-web/src/main/js/helpers/testMocks.ts
new file mode 100644 (file)
index 0000000..daa9617
--- /dev/null
@@ -0,0 +1,126 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2019 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.
+ */
+import { InjectedRouter } from 'react-router';
+import { Location } from 'history';
+import { Profile } from '../apps/quality-profiles/types';
+
+export function mockAppState(overrides: Partial<T.AppState> = {}): T.AppState {
+  return {
+    defaultOrganization: 'foo',
+    edition: 'community',
+    productionDatabase: true,
+    qualifiers: ['TRK'],
+    settings: {},
+    version: '1.0',
+    ...overrides
+  };
+}
+
+export function mockComponent(overrides: Partial<T.Component> = {}): T.Component {
+  return {
+    breadcrumbs: [],
+    key: 'my-project',
+    name: 'MyProject',
+    organization: 'foo',
+    qualifier: 'TRK',
+    qualityGate: { isDefault: true, key: '30', name: 'Sonar way' },
+    qualityProfiles: [
+      {
+        deleted: false,
+        key: 'my-qp',
+        language: 'ts',
+        name: 'Sonar way'
+      }
+    ],
+    tags: [],
+    ...overrides
+  };
+}
+
+export function mockCurrentUser(overrides: Partial<T.CurrentUser> = {}): T.CurrentUser {
+  return {
+    isLoggedIn: true,
+    ...overrides
+  };
+}
+
+export function mockEvent(overrides = {}) {
+  return {
+    target: { blur() {} },
+    currentTarget: { blur() {} },
+    preventDefault() {},
+    stopPropagation() {},
+    ...overrides
+  } as any;
+}
+
+export function mockLocation(overrides: Partial<Location> = {}): Location {
+  return {
+    action: 'PUSH',
+    key: 'key',
+    pathname: '/path',
+    query: {},
+    search: '',
+    state: {},
+    ...overrides
+  };
+}
+
+export function mockOrganization(overrides: Partial<T.Organization> = {}): T.Organization {
+  return {
+    key: 'foo',
+    name: 'Foo',
+    ...overrides
+  };
+}
+
+export function mockQualityProfile(overrides: Partial<Profile> = {}): Profile {
+  return {
+    activeDeprecatedRuleCount: 2,
+    activeRuleCount: 10,
+    childrenCount: 0,
+    depth: 1,
+    isBuiltIn: false,
+    isDefault: false,
+    isInherited: false,
+    key: 'key',
+    language: 'js',
+    languageName: 'JavaScript',
+    name: 'name',
+    projectCount: 3,
+    organization: 'foo',
+    ...overrides
+  };
+}
+
+export function mockRouter(overrides: { push?: Function; replace?: Function } = {}) {
+  return {
+    createHref: jest.fn(),
+    createPath: jest.fn(),
+    go: jest.fn(),
+    goBack: jest.fn(),
+    goForward: jest.fn(),
+    isActive: jest.fn(),
+    push: jest.fn(),
+    replace: jest.fn(),
+    setRouteLeaveHook: jest.fn(),
+    ...overrides
+  } as InjectedRouter;
+}
index 8e376ea585305e54c79b857a5cb24e5abd4e2b9c..065bba4e3402221f51dc665cfd1c243c153c90c6 100644 (file)
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import { ShallowWrapper, ReactWrapper } from 'enzyme';
-import { InjectedRouter } from 'react-router';
-import { Location } from 'history';
-import { EditionKey } from '../apps/marketplace/utils';
-
-export const mockEvent = {
-  target: { blur() {} },
-  currentTarget: { blur() {} },
-  preventDefault() {},
-  stopPropagation() {}
-};
+import { mockEvent } from './testMocks';
 
 export function click(element: ShallowWrapper | ReactWrapper, event = {}): void {
   // `type()` returns a component constructor for a composite element and string for DOM nodes
@@ -37,7 +28,7 @@ export function click(element: ShallowWrapper | ReactWrapper, event = {}): void
     // https://github.com/airbnb/enzyme/blob/master/packages/enzyme/src/ReactWrapper.js#L109
     (element as any).root().update();
   } else {
-    element.simulate('click', { ...mockEvent, ...event });
+    element.simulate('click', mockEvent(event));
   }
 }
 
@@ -152,78 +143,3 @@ export async function waitAndUpdate(wrapper: ShallowWrapper<any, any> | ReactWra
   await new Promise(setImmediate);
   wrapper.update();
 }
-
-export function mockLocation(overrides = {}): Location {
-  return {
-    action: 'PUSH',
-    key: 'key',
-    pathname: '/path',
-    query: {},
-    search: '',
-    state: {},
-    ...overrides
-  };
-}
-
-export function mockRouter(overrides: { push?: Function; replace?: Function } = {}) {
-  return {
-    createHref: jest.fn(),
-    createPath: jest.fn(),
-    go: jest.fn(),
-    goBack: jest.fn(),
-    goForward: jest.fn(),
-    isActive: jest.fn(),
-    push: jest.fn(),
-    replace: jest.fn(),
-    setRouteLeaveHook: jest.fn(),
-    ...overrides
-  } as InjectedRouter;
-}
-
-export function mockAppState(overrides = {}): T.AppState {
-  return {
-    defaultOrganization: 'foo',
-    edition: EditionKey.community,
-    productionDatabase: true,
-    qualifiers: ['TRK'],
-    settings: {},
-    version: '1.0',
-    ...overrides
-  };
-}
-
-export function mockComponent(overrides = {}): T.Component {
-  return {
-    breadcrumbs: [],
-    key: 'my-project',
-    name: 'MyProject',
-    organization: 'foo',
-    qualifier: 'TRK',
-    qualityGate: { isDefault: true, key: '30', name: 'Sonar way' },
-    qualityProfiles: [
-      {
-        deleted: false,
-        key: 'my-qp',
-        language: 'ts',
-        name: 'Sonar way'
-      }
-    ],
-    tags: [],
-    ...overrides
-  };
-}
-
-export function mockCurrentUser(overrides = {}): T.CurrentUser {
-  return {
-    isLoggedIn: true,
-    ...overrides
-  };
-}
-
-export function mockOrganization(overrides = {}): T.Organization {
-  return {
-    key: 'foo',
-    name: 'Foo',
-    ...overrides
-  };
-}