Commit 70c84e15 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'nfriend-atmtwps-merge-immediately-dialog' into 'master'

Show "merge immediately" dialog when MR's pipeline has not yet finished

See merge request gitlab-org/gitlab!21556
parents a0de16c7 6a56ff9a
---
title: Show merge immediately dialog even if the MR's pipeline hasn't finished
merge_request: 21556
author:
type: changed
...@@ -50,7 +50,7 @@ export default { ...@@ -50,7 +50,7 @@ export default {
return this.mr.isPipelineActive && !this.mr.onlyAllowMergeIfPipelineSucceeds; return this.mr.isPipelineActive && !this.mr.onlyAllowMergeIfPipelineSucceeds;
}, },
isMergeImmediatelyDangerous() { isMergeImmediatelyDangerous() {
return this.mr.preferredAutoMergeStrategy === MT_MERGE_STRATEGY; return [MT_MERGE_STRATEGY, MTWPS_MERGE_STRATEGY].includes(this.mr.preferredAutoMergeStrategy);
}, },
}, },
}; };
...@@ -154,7 +154,7 @@ describe('ReadyToMerge', () => { ...@@ -154,7 +154,7 @@ describe('ReadyToMerge', () => {
}); });
describe('isMergeImmediatelyDangerous', () => { describe('isMergeImmediatelyDangerous', () => {
it('should return false if the preferred auto merge strategy is not merge trains', () => { it('should return false if the preferred auto merge strategy is not merge train-related', () => {
factory({ preferredAutoMergeStrategy: MWPS_MERGE_STRATEGY }); factory({ preferredAutoMergeStrategy: MWPS_MERGE_STRATEGY });
expect(vm.isMergeImmediatelyDangerous).toBe(false); expect(vm.isMergeImmediatelyDangerous).toBe(false);
...@@ -165,6 +165,12 @@ describe('ReadyToMerge', () => { ...@@ -165,6 +165,12 @@ describe('ReadyToMerge', () => {
expect(vm.isMergeImmediatelyDangerous).toBe(true); expect(vm.isMergeImmediatelyDangerous).toBe(true);
}); });
it('should return true if the preferred auto merge strategy is merge trains when pipeline succeeds', () => {
factory({ preferredAutoMergeStrategy: MTWPS_MERGE_STRATEGY });
expect(vm.isMergeImmediatelyDangerous).toBe(true);
});
}); });
}); });
......
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