]> source.dussan.org Git - sonarqube.git/commitdiff
Fix quality flaws
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>
Fri, 3 Aug 2018 13:23:27 +0000 (15:23 +0200)
committerSonarTech <sonartech@sonarsource.com>
Fri, 10 Aug 2018 18:21:31 +0000 (20:21 +0200)
server/sonar-bitbucketcloud/src/main/ts/components/Config.tsx
server/sonar-bitbucketcloud/src/main/ts/components/__tests__/Config-test.tsx
server/sonar-bitbucketcloud/src/main/ts/components/__tests__/__snapshots__/Config-test.tsx.snap

index d8818f58ac39f329d1f001fad93064aab5cfd785..eac079cbdcd6b44ebd1eb82378730be553fe69b1 100644 (file)
@@ -198,7 +198,7 @@ export default class Config extends React.PureComponent<Props, State> {
       descriptionComponent = (
         <>
           This repository is already bound to a{' '}
-          <a href={getBaseUrl() + '/dashboard?id=' + encodeURIComponent(projectKey)}>
+          <a href={`${getBaseUrl()}/dashboard?id=${encodeURIComponent(projectKey)}`}>
             SonarCloud project
           </a>
         </>
@@ -227,8 +227,8 @@ export default class Config extends React.PureComponent<Props, State> {
         <>
           <p>
             You don&apos;t have any project on SonarCloud yet:{' '}
-            <a href={getBaseUrl() + '/onboarding'} rel="noopener noreferrer" target="_blank">
-              Analyse a project
+            <a href={getBaseUrl() + '/projects/create'} rel="noopener noreferrer" target="_blank">
+              Create a project
             </a>
           </p>
         </>
index 0dee0434d1eedb2f3da0d638fbd86c712637270f..886013dafd65335bd1dd5b7976bdae3549eaf09f 100644 (file)
@@ -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<any>).mockClear();
   (getMyProjects as jest.Mock<any>).mockClear();
+  (isManualBindingAllowed as jest.Mock<any>).mockClear();
+  (isManualBindingAllowed as jest.Mock<any>).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<any>).mockReturnValue(false);
-  expect(getWrapper()).toMatchSnapshot();
-  (isManualBindingAllowed as jest.Mock<any>).mockReturnValue(true);
+  expect(getWrapper({ projectKey: undefined })).toMatchSnapshot();
 });
 
 it('should display correctly for auto binding with already a projectKey', () => {
   (isManualBindingAllowed as jest.Mock<any>).mockReturnValue(false);
   expect(getWrapper()).toMatchSnapshot();
-  (isManualBindingAllowed as jest.Mock<any>).mockReturnValue(true);
 });
 
 it('should display the authentication component and the display checkbox', async () => {
index 1667e404154a4496e38e2fa4c79304beac2947cd..032abbe04011a466d3f60e350b39190110b3983a 100644 (file)
@@ -254,13 +254,14 @@ exports[`should display correctly for auto binding 1`] = `
       className="settings-description"
     >
       <React.Fragment>
-        This repository is already bound to a
+        To display the quality of your repository, you have to
          
         <a
-          href="/dashboard?id=foo"
+          href="/projects/create"
         >
-          SonarCloud project
+          provision
         </a>
+         a project on SonarCloud and trigger an analysis.
       </React.Fragment>
     </p>
     <React.Fragment>