diff options
author | Siegfried Ehret <siegfried.ehret@sonarsource.com> | 2019-08-02 10:09:38 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2019-08-05 20:21:12 +0200 |
commit | b1eca3fed16d89ed8c8bb45d560ab84af4130602 (patch) | |
tree | a396e5b0d90c1c7f7ca36fe2c3feafda3fa9364b /server/sonar-web/src/main/js/components/SourceViewer/__tests__ | |
parent | f6d3dfaa4195fba63a1e07cfe2764ff33a912403 (diff) | |
download | sonarqube-b1eca3fed16d89ed8c8bb45d560ab84af4130602.tar.gz sonarqube-b1eca3fed16d89ed8c8bb45d560ab84af4130602.zip |
SONAR-12199 Update tests
Diffstat (limited to 'server/sonar-web/src/main/js/components/SourceViewer/__tests__')
2 files changed, 49 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/components/SourceViewer/__tests__/SourceViewerBase-test.tsx b/server/sonar-web/src/main/js/components/SourceViewer/__tests__/SourceViewerBase-test.tsx new file mode 100644 index 00000000000..6a6ef630b2d --- /dev/null +++ b/server/sonar-web/src/main/js/components/SourceViewer/__tests__/SourceViewerBase-test.tsx @@ -0,0 +1,30 @@ +/* + * SonarQube + * Copyright (C) 2009-2019 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import SourceViewerBase from '../SourceViewerBase'; +import { mockMainBranch } from '../../../helpers/testMocks'; + +it('should render correctly', () => { + expect(shallowRender()).toMatchSnapshot(); +}); + +function shallowRender() { + return <SourceViewerBase branchLike={mockMainBranch()} component="my-component" />; +} diff --git a/server/sonar-web/src/main/js/components/SourceViewer/__tests__/__snapshots__/SourceViewerBase-test.tsx.snap b/server/sonar-web/src/main/js/components/SourceViewer/__tests__/__snapshots__/SourceViewerBase-test.tsx.snap new file mode 100644 index 00000000000..66538d4b69b --- /dev/null +++ b/server/sonar-web/src/main/js/components/SourceViewer/__tests__/__snapshots__/SourceViewerBase-test.tsx.snap @@ -0,0 +1,19 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly 1`] = ` +<SourceViewerBase + branchLike={ + Object { + "analysisDate": "2018-01-01", + "isMain": true, + "name": "master", + } + } + component="my-component" + displayAllIssues={false} + displayLocationMarkers={true} + loadComponent={[Function]} + loadIssues={[Function]} + loadSources={[Function]} +/> +`; |