Commit 6a56ff9a authored by Nathan Friend's avatar Nathan Friend

Show merge immediately dialog even if pipeline hasn't succeeded

parent 9fc2e14b
---
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