]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-11313 enable locations navigator when selecting a flow
authorStas Vilchik <stas.vilchik@sonarsource.com>
Fri, 12 Oct 2018 08:26:15 +0000 (10:26 +0200)
committerSonarTech <sonartech@sonarsource.com>
Fri, 12 Oct 2018 18:20:58 +0000 (20:20 +0200)
server/sonar-web/src/main/js/apps/issues/__tests__/actions-test.ts [new file with mode: 0644]
server/sonar-web/src/main/js/apps/issues/actions.ts

diff --git a/server/sonar-web/src/main/js/apps/issues/__tests__/actions-test.ts b/server/sonar-web/src/main/js/apps/issues/__tests__/actions-test.ts
new file mode 100644 (file)
index 0000000..26e8f0a
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2018 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 { selectFlow } from '../actions';
+
+it('should select flow and enable locations navigator', () => {
+  expect(selectFlow(5)()).toEqual({
+    locationsNavigator: true,
+    selectedFlowIndex: 5,
+    selectedLocationIndex: 0
+  });
+});
index 76da57eb2fe0a571006fb0124ee24475bd230a28..443a9b01c667ed6ecbea9c3cd60319d5782df502 100644 (file)
@@ -100,7 +100,7 @@ export function selectPreviousLocation(state: State) {
 
 export function selectFlow(nextIndex?: number) {
   return () => {
-    return { selectedFlowIndex: nextIndex, selectedLocationIndex: 0 };
+    return { locationsNavigator: true, selectedFlowIndex: nextIndex, selectedLocationIndex: 0 };
   };
 }