From e24f1b14536dc7268d03495f6ef281698ff09184 Mon Sep 17 00:00:00 2001 From: Mathieu Suen Date: Mon, 26 Oct 2020 15:00:18 +0100 Subject: [PATCH] SONAR-14043 Write End-to-End tests for Applications --- .../ProjectInformationRenderer.tsx | 4 +++- .../__tests__/ProjectInformationRenderer-test.tsx | 4 ++-- .../ProjectInformationRenderer-test.tsx.snap | 13 +++++++++---- 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 )} - {component.description &&

{component.description}

} + {component.description && ( +

{component.description}

+ )} 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`] = ` `; -exports[`should render without description 1`] = ` +exports[`should render with description 1`] = `

+

+ Lorem ipsum +