From: Grégoire Aubert
Date: Fri, 3 Aug 2018 13:23:27 +0000 (+0200)
Subject: Fix quality flaws
X-Git-Tag: 7.5~613
X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ccf836d2de4bfba561571fb263433c7bdadd2b9f;p=sonarqube.git
Fix quality flaws
---
diff --git a/server/sonar-bitbucketcloud/src/main/ts/components/Config.tsx b/server/sonar-bitbucketcloud/src/main/ts/components/Config.tsx
index d8818f58ac3..eac079cbdcd 100644
--- a/server/sonar-bitbucketcloud/src/main/ts/components/Config.tsx
+++ b/server/sonar-bitbucketcloud/src/main/ts/components/Config.tsx
@@ -198,7 +198,7 @@ export default class Config extends React.PureComponent {
descriptionComponent = (
<>
This repository is already bound to a{' '}
-
+
SonarCloud project
>
@@ -227,8 +227,8 @@ export default class Config extends React.PureComponent {
<>
You don't have any project on SonarCloud yet:{' '}
-
- Analyse a project
+
+ Create a project
>
diff --git a/server/sonar-bitbucketcloud/src/main/ts/components/__tests__/Config-test.tsx b/server/sonar-bitbucketcloud/src/main/ts/components/__tests__/Config-test.tsx
index 0dee0434d1e..886013dafd6 100644
--- a/server/sonar-bitbucketcloud/src/main/ts/components/__tests__/Config-test.tsx
+++ b/server/sonar-bitbucketcloud/src/main/ts/components/__tests__/Config-test.tsx
@@ -25,7 +25,7 @@ import { isManualBindingAllowed } from '../../utils';
jest.mock('../../utils', () => ({
displayMessage: jest.fn(),
- isManualBindingAllowed: jest.fn(() => true)
+ isManualBindingAllowed: jest.fn()
}));
jest.mock('../../api', () => ({
@@ -48,6 +48,8 @@ const CONTEXT = { jwt: '' };
beforeEach(() => {
(bindProject as jest.Mock).mockClear();
(getMyProjects as jest.Mock).mockClear();
+ (isManualBindingAllowed as jest.Mock).mockClear();
+ (isManualBindingAllowed as jest.Mock).mockReturnValue(true);
});
it('should display correctly', async () => {
@@ -62,14 +64,12 @@ it('should display correctly', async () => {
it('should display correctly for auto binding', () => {
(isManualBindingAllowed as jest.Mock).mockReturnValue(false);
- expect(getWrapper()).toMatchSnapshot();
- (isManualBindingAllowed as jest.Mock).mockReturnValue(true);
+ expect(getWrapper({ projectKey: undefined })).toMatchSnapshot();
});
it('should display correctly for auto binding with already a projectKey', () => {
(isManualBindingAllowed as jest.Mock).mockReturnValue(false);
expect(getWrapper()).toMatchSnapshot();
- (isManualBindingAllowed as jest.Mock).mockReturnValue(true);
});
it('should display the authentication component and the display checkbox', async () => {
diff --git a/server/sonar-bitbucketcloud/src/main/ts/components/__tests__/__snapshots__/Config-test.tsx.snap b/server/sonar-bitbucketcloud/src/main/ts/components/__tests__/__snapshots__/Config-test.tsx.snap
index 1667e404154..032abbe0401 100644
--- a/server/sonar-bitbucketcloud/src/main/ts/components/__tests__/__snapshots__/Config-test.tsx.snap
+++ b/server/sonar-bitbucketcloud/src/main/ts/components/__tests__/__snapshots__/Config-test.tsx.snap
@@ -254,13 +254,14 @@ exports[`should display correctly for auto binding 1`] = `
className="settings-description"
>
- This repository is already bound to a
+ To display the quality of your repository, you have to
- SonarCloud project
+ provision
+ a project on SonarCloud and trigger an analysis.