aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web
diff options
context:
space:
mode:
authorMathieu Suen <mathieu.suen@sonarsource.com>2020-10-26 15:00:18 +0100
committersonartech <sonartech@sonarsource.com>2020-11-28 20:06:15 +0000
commite24f1b14536dc7268d03495f6ef281698ff09184 (patch)
tree75d9b5fb96450895b5963eb31b974672187975b0 /server/sonar-web
parent341877deff2ea1d1e87e30be0f592dbf95996920 (diff)
downloadsonarqube-e24f1b14536dc7268d03495f6ef281698ff09184.tar.gz
sonarqube-e24f1b14536dc7268d03495f6ef281698ff09184.zip
SONAR-14043 Write End-to-End tests for Applications
Diffstat (limited to 'server/sonar-web')
-rw-r--r--server/sonar-web/src/main/js/app/components/nav/component/projectInformation/ProjectInformationRenderer.tsx4
-rw-r--r--server/sonar-web/src/main/js/app/components/nav/component/projectInformation/__tests__/ProjectInformationRenderer-test.tsx4
-rw-r--r--server/sonar-web/src/main/js/app/components/nav/component/projectInformation/__tests__/__snapshots__/ProjectInformationRenderer-test.tsx.snap13
3 files changed, 14 insertions, 7 deletions
diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/ProjectInformationRenderer.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/ProjectInformationRenderer.tsx
index df0c03d8a15..8dcdb84784b 100644
--- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/ProjectInformationRenderer.tsx
+++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/ProjectInformationRenderer.tsx
@@ -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>
diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/__tests__/ProjectInformationRenderer-test.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/__tests__/ProjectInformationRenderer-test.tsx
index 26f2ab9ff25..6f9f637cb80 100644
--- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/__tests__/ProjectInformationRenderer-test.tsx
+++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/__tests__/ProjectInformationRenderer-test.tsx
@@ -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();
});
diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/__tests__/__snapshots__/ProjectInformationRenderer-test.tsx.snap b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/__tests__/__snapshots__/ProjectInformationRenderer-test.tsx.snap
index 2531e3c9133..dc7980c1b30 100644
--- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/__tests__/__snapshots__/ProjectInformationRenderer-test.tsx.snap
+++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/__tests__/__snapshots__/ProjectInformationRenderer-test.tsx.snap
@@ -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",