]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-14043 Write End-to-End tests for Applications
authorMathieu Suen <mathieu.suen@sonarsource.com>
Mon, 26 Oct 2020 14:00:18 +0000 (15:00 +0100)
committersonartech <sonartech@sonarsource.com>
Sat, 28 Nov 2020 20:06:15 +0000 (20:06 +0000)
server/sonar-web/src/main/js/app/components/nav/component/projectInformation/ProjectInformationRenderer.tsx
server/sonar-web/src/main/js/app/components/nav/component/projectInformation/__tests__/ProjectInformationRenderer-test.tsx
server/sonar-web/src/main/js/app/components/nav/component/projectInformation/__tests__/__snapshots__/ProjectInformationRenderer-test.tsx.snap

index df0c03d8a151da438a3fea7f3a0015018aca6fab..8dcdb84784b41a997643e0afcc3beba1a1d0e1f2 100644 (file)
@@ -64,7 +64,9 @@ export function ProjectInformationRenderer(props: ProjectInformationRendererProp
             )}
           </div>
 
-          {component.description && <p>{component.description}</p>}
+          {component.description && (
+            <p className="it__project-description">{component.description}</p>
+          )}
 
           <MetaTags component={component} onComponentChange={props.onComponentChange} />
         </div>
index 26f2ab9ff25ce514690f370067e0611fbcfbb055..6f9f637cb800401be0e2aa3f8d51fc1bbd1a6f67 100644 (file)
@@ -43,8 +43,8 @@ it('should render an app correctly', () => {
   expect(shallowRender({ component })).toMatchSnapshot('default');
 });
 
-it('should render without description', () => {
-  const component = mockComponent({ description: undefined });
+it('should render with description', () => {
+  const component = mockComponent({ description: 'Lorem ipsum' });
   expect(shallowRender({ component })).toMatchSnapshot();
 });
 
index 2531e3c91338ef979771541d1f0ea61fd41fa8fd..dc7980c1b30df7814a79a174ccf2a7b64adb3447 100644 (file)
@@ -983,7 +983,7 @@ exports[`should render correctly: with notifications 1`] = `
 </Fragment>
 `;
 
-exports[`should render without description 1`] = `
+exports[`should render with description 1`] = `
 <Fragment>
   <div>
     <h2
@@ -1007,11 +1007,16 @@ exports[`should render without description 1`] = `
           project.info.description
         </h3>
       </div>
+      <p
+        className="it__project-description"
+      >
+        Lorem ipsum
+      </p>
       <MetaTags
         component={
           Object {
             "breadcrumbs": Array [],
-            "description": undefined,
+            "description": "Lorem ipsum",
             "key": "my-project",
             "name": "MyProject",
             "organization": "foo",
@@ -1042,7 +1047,7 @@ exports[`should render without description 1`] = `
         component={
           Object {
             "breadcrumbs": Array [],
-            "description": undefined,
+            "description": "Lorem ipsum",
             "key": "my-project",
             "name": "MyProject",
             "organization": "foo",
@@ -1096,7 +1101,7 @@ exports[`should render without description 1`] = `
       component={
         Object {
           "breadcrumbs": Array [],
-          "description": undefined,
+          "description": "Lorem ipsum",
           "key": "my-project",
           "name": "MyProject",
           "organization": "foo",