]> source.dussan.org Git - sonarqube.git/commitdiff
fix file permalink with branch
authorStas Vilchik <stas.vilchik@sonarsource.com>
Fri, 20 Oct 2017 13:26:27 +0000 (15:26 +0200)
committerStas Vilchik <stas.vilchik@sonarsource.com>
Mon, 23 Oct 2017 06:57:31 +0000 (08:57 +0200)
server/sonar-web/src/main/js/app/components/ComponentContainer.tsx
server/sonar-web/src/main/js/app/components/__tests__/ComponentContainer-test.tsx

index a20ec1d527c7807e7b3067ff7ab9fdcb8d184c47..b1b2ac07fad6c6045b0acc8444eb69801ae23432 100644 (file)
@@ -89,7 +89,10 @@ export class ComponentContainer extends React.PureComponent<Props, State> {
       }
     };
 
-    Promise.all([getComponentNavigation(id), getComponentData(id, branch)]).then(([nav, data]) => {
+    Promise.all([
+      getComponentNavigation(id, branch),
+      getComponentData(id, branch)
+    ]).then(([nav, data]) => {
       const component = this.addQualifier({ ...nav, ...data });
 
       if (this.props.organizationsEnabled) {
index cd5be6f916cd6b02d4b7cdbeeac8a78cdfa6abb3..ed7838f8ea37e4b075c099da2e19c2c568538528 100644 (file)
@@ -80,7 +80,7 @@ it("loads branches for module's project", () => {
   return doAsync().then(() => {
     expect(getBranches).toBeCalledWith('projectKey');
     expect(getComponentData).toBeCalledWith('moduleKey', undefined);
-    expect(getComponentNavigation).toBeCalledWith('moduleKey');
+    expect(getComponentNavigation).toBeCalledWith('moduleKey', undefined);
   });
 });
 
@@ -102,7 +102,7 @@ it("doesn't load branches portfolio", () => {
   return doAsync().then(() => {
     expect(getBranches).not.toBeCalled();
     expect(getComponentData).toBeCalledWith('portfolioKey', undefined);
-    expect(getComponentNavigation).toBeCalledWith('portfolioKey');
+    expect(getComponentNavigation).toBeCalledWith('portfolioKey', undefined);
     expect(wrapper.find(Inner).exists()).toBeTruthy();
   });
 });