aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/components/common/__tests__
diff options
context:
space:
mode:
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>2019-05-09 14:36:39 +0200
committerSonarTech <sonartech@sonarsource.com>2019-06-03 20:21:18 +0200
commit41b935a39f1d3358f3baa9ff91231f9fa2571697 (patch)
treef8b77072dc1d940ed9dc05ebd4965b36878a72a2 /server/sonar-web/src/main/js/components/common/__tests__
parentac64b4fe18f42fdbc1d54c3409cee2a74e234051 (diff)
downloadsonarqube-41b935a39f1d3358f3baa9ff91231f9fa2571697.tar.gz
sonarqube-41b935a39f1d3358f3baa9ff91231f9fa2571697.zip
SONAR-12055 Display administration navbar notification when restarting the server
Diffstat (limited to 'server/sonar-web/src/main/js/components/common/__tests__')
-rw-r--r--server/sonar-web/src/main/js/components/common/__tests__/RestartButton-test.tsx30
-rw-r--r--server/sonar-web/src/main/js/components/common/__tests__/__snapshots__/RestartButton-test.tsx.snap23
2 files changed, 53 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/components/common/__tests__/RestartButton-test.tsx b/server/sonar-web/src/main/js/components/common/__tests__/RestartButton-test.tsx
new file mode 100644
index 00000000000..3aecf0ae55f
--- /dev/null
+++ b/server/sonar-web/src/main/js/components/common/__tests__/RestartButton-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 { shallow } from 'enzyme';
+import RestartButton from '../RestartButton';
+
+it('should render correctly', () => {
+ expect(shallowRender()).toMatchSnapshot();
+});
+
+function shallowRender(props: Partial<RestartButton['props']> = {}) {
+ return shallow(<RestartButton fetchSystemStatus={jest.fn()} systemStatus={'UP'} {...props} />);
+}
diff --git a/server/sonar-web/src/main/js/components/common/__tests__/__snapshots__/RestartButton-test.tsx.snap b/server/sonar-web/src/main/js/components/common/__tests__/__snapshots__/RestartButton-test.tsx.snap
new file mode 100644
index 00000000000..90940e63cbb
--- /dev/null
+++ b/server/sonar-web/src/main/js/components/common/__tests__/__snapshots__/RestartButton-test.tsx.snap
@@ -0,0 +1,23 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`should render correctly 1`] = `
+<ConfirmButton
+ confirmButtonText="restart"
+ modalBody={
+ <React.Fragment>
+ <p
+ className="spacer-top spacer-bottom"
+ >
+ system.are_you_sure_to_restart
+ </p>
+ <p>
+ system.forcing_shutdown_not_recommended
+ </p>
+ </React.Fragment>
+ }
+ modalHeader="system.restart_server"
+ onConfirm={[Function]}
+>
+ <Component />
+</ConfirmButton>
+`;