Commit dd70776f authored by Fatih Acet's avatar Fatih Acet

MRWidget: Use targetBranchPath in everywhere.

parent 5d7d5098
...@@ -83,7 +83,7 @@ export default { ...@@ -83,7 +83,7 @@ export default {
:title="isBranchTitleLong(mr.targetBranch) ? mr.targetBranch : ''" :title="isBranchTitleLong(mr.targetBranch) ? mr.targetBranch : ''"
data-placement="bottom"> data-placement="bottom">
<a <a
:href="mr.targetBranchCommitsPath"> :href="mr.targetBranchPath">
{{mr.targetBranch}} {{mr.targetBranch}}
</a> </a>
</span> </span>
......
...@@ -20,7 +20,7 @@ export default { ...@@ -20,7 +20,7 @@ export default {
<p> <p>
The changes were not merged into The changes were not merged into
<a <a
:href="mr.targetBranchCommitsPath" :href="mr.targetBranchPath"
class="label-branch"> class="label-branch">
{{mr.targetBranch}}</a>. {{mr.targetBranch}}</a>.
</p> </p>
......
...@@ -43,7 +43,6 @@ export default class MergeRequestStore { ...@@ -43,7 +43,6 @@ export default class MergeRequestStore {
this.mergeUserId = data.merge_user_id; this.mergeUserId = data.merge_user_id;
this.currentUserId = gon.current_user_id; this.currentUserId = gon.current_user_id;
this.sourceBranchPath = data.source_branch_path; this.sourceBranchPath = data.source_branch_path;
this.targetBranchCommitsPath = data.target_branch_commits_path;
this.sourceBranchLink = data.source_branch_with_namespace_link; this.sourceBranchLink = data.source_branch_with_namespace_link;
this.mergeError = data.merge_error; this.mergeError = data.merge_error;
this.targetBranchPath = data.target_branch_commits_path; this.targetBranchPath = data.target_branch_commits_path;
......
...@@ -53,7 +53,7 @@ describe('MRWidgetHeader', () => { ...@@ -53,7 +53,7 @@ describe('MRWidgetHeader', () => {
divergedCommitsCount: 12, divergedCommitsCount: 12,
sourceBranch: 'mr-widget-refactor', sourceBranch: 'mr-widget-refactor',
sourceBranchLink: `<a href="${sourceBranchPath}">mr-widget-refactor</a>`, sourceBranchLink: `<a href="${sourceBranchPath}">mr-widget-refactor</a>`,
targetBranchCommitsPath: 'foo/bar/commits-path', targetBranchPath: 'foo/bar/commits-path',
targetBranch: 'master', targetBranch: 'master',
isOpen: true, isOpen: true,
emailPatchesPath: '/mr/email-patches', emailPatchesPath: '/mr/email-patches',
...@@ -73,7 +73,7 @@ describe('MRWidgetHeader', () => { ...@@ -73,7 +73,7 @@ describe('MRWidgetHeader', () => {
expect(sourceBranchLink.textContent).toContain(mr.sourceBranch); expect(sourceBranchLink.textContent).toContain(mr.sourceBranch);
expect(targetBranchLink.textContent).toContain(mr.targetBranch); expect(targetBranchLink.textContent).toContain(mr.targetBranch);
expect(sourceBranchLink.querySelector('a').getAttribute('href')).toEqual(sourceBranchPath); expect(sourceBranchLink.querySelector('a').getAttribute('href')).toEqual(sourceBranchPath);
expect(targetBranchLink.querySelector('a').getAttribute('href')).toEqual(mr.targetBranchCommitsPath); expect(targetBranchLink.querySelector('a').getAttribute('href')).toEqual(mr.targetBranchPath);
expect(el.querySelector('.diverged-commits-count').textContent).toContain('12 commits behind'); expect(el.querySelector('.diverged-commits-count').textContent).toContain('12 commits behind');
expect(el.textContent).toContain('Check out branch'); expect(el.textContent).toContain('Check out branch');
......
...@@ -3,7 +3,7 @@ import closedComponent from '~/vue_merge_request_widget/components/states/mr_wid ...@@ -3,7 +3,7 @@ import closedComponent from '~/vue_merge_request_widget/components/states/mr_wid
const mr = { const mr = {
targetBranch: 'good-branch', targetBranch: 'good-branch',
targetBranchCommitsPath: '/good-branch', targetBranchPath: '/good-branch',
closedBy: { closedBy: {
name: 'Fatih Acet', name: 'Fatih Acet',
username: 'fatihacet', username: 'fatihacet',
...@@ -44,7 +44,7 @@ describe('MRWidgetClosed', () => { ...@@ -44,7 +44,7 @@ describe('MRWidgetClosed', () => {
expect(el.querySelector('h4').textContent).toContain('Closed by'); expect(el.querySelector('h4').textContent).toContain('Closed by');
expect(el.querySelector('h4').textContent).toContain(mr.closedBy.name); expect(el.querySelector('h4').textContent).toContain(mr.closedBy.name);
expect(el.textContent).toContain('The changes were not merged into'); expect(el.textContent).toContain('The changes were not merged into');
expect(el.querySelector('.label-branch').getAttribute('href')).toEqual(mr.targetBranchCommitsPath); expect(el.querySelector('.label-branch').getAttribute('href')).toEqual(mr.targetBranchPath);
expect(el.querySelector('.label-branch').textContent).toContain(mr.targetBranch); expect(el.querySelector('.label-branch').textContent).toContain(mr.targetBranch);
}); });
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment