Commit b4297573 authored by Mark Chao's avatar Mark Chao Committed by Phil Hughes

Only display merge commit SHA when it exists

parent 0a89c0b8
...@@ -162,6 +162,7 @@ ...@@ -162,6 +162,7 @@
<span class="label-branch"> <span class="label-branch">
<a :href="mr.targetBranchPath">{{ mr.targetBranch }}</a> <a :href="mr.targetBranchPath">{{ mr.targetBranch }}</a>
</span> </span>
<template v-if="mr.mergeCommitSha">
with with
<a <a
:href="mr.mergeCommitPath" :href="mr.mergeCommitPath"
...@@ -174,6 +175,7 @@ ...@@ -174,6 +175,7 @@
:text="mr.mergeCommitSha" :text="mr.mergeCommitSha"
css-class="btn-default btn-transparent btn-clipboard js-mr-merged-copy-sha" css-class="btn-default btn-transparent btn-clipboard js-mr-merged-copy-sha"
/> />
</template>
</p> </p>
<p v-if="mr.sourceBranchRemoved"> <p v-if="mr.sourceBranchRemoved">
{{ s__("mrWidget|The source branch has been removed") }} {{ s__("mrWidget|The source branch has been removed") }}
......
---
title: Fix 'merged with' UI being displayed when merge request has no merge commit
merge_request: 22022
author:
type: fixed
...@@ -157,6 +157,16 @@ describe('MRWidgetMerged', () => { ...@@ -157,6 +157,16 @@ describe('MRWidgetMerged', () => {
expect(selectors.copyMergeShaButton.getAttribute('data-clipboard-text')).toBe(vm.mr.mergeCommitSha); expect(selectors.copyMergeShaButton.getAttribute('data-clipboard-text')).toBe(vm.mr.mergeCommitSha);
}); });
it('hides button to copy commit SHA if SHA does not exist', (done) => {
vm.mr.mergeCommitSha = null;
Vue.nextTick(() => {
expect(selectors.copyMergeShaButton).not.toExist();
expect(vm.$el.querySelector('.mr-info-list').innerText).not.toContain('with');
done();
});
});
it('shows merge commit SHA link', () => { it('shows merge commit SHA link', () => {
expect(selectors.mergeCommitShaLink).toExist(); expect(selectors.mergeCommitShaLink).toExist();
expect(selectors.mergeCommitShaLink.text).toContain(vm.mr.shortMergeCommitSha); expect(selectors.mergeCommitShaLink.text).toContain(vm.mr.shortMergeCommitSha);
......
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