From b5ced5bc4727e6a4757c51b447b0979096a0f7b9 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Fri, 20 Oct 2017 15:26:27 +0200 Subject: [PATCH] fix file permalink with branch --- .../src/main/js/app/components/ComponentContainer.tsx | 5 ++++- .../js/app/components/__tests__/ComponentContainer-test.tsx | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx b/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx index a20ec1d527c..b1b2ac07fad 100644 --- a/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx +++ b/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx @@ -89,7 +89,10 @@ export class ComponentContainer extends React.PureComponent { } }; - 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) { diff --git a/server/sonar-web/src/main/js/app/components/__tests__/ComponentContainer-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/ComponentContainer-test.tsx index cd5be6f916c..ed7838f8ea3 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/ComponentContainer-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/ComponentContainer-test.tsx @@ -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(); }); }); -- 2.39.5