diff options
author | Nathan Friend <nathan@gitlab.com> | 2019-04-24 12:19:15 -0300 |
---|---|---|
committer | Nathan Friend <nathan@gitlab.com> | 2019-04-24 12:19:15 -0300 |
commit | ca6e946f0f50d997ecad7d3758fe362cf0fae5ce (patch) | |
tree | 37aac79b0d87304d22a4dea23a90567b09d6da51 /spec/javascripts | |
parent | 951ffd9ddeeb6154a5929849f9b2f4c92c24c2a4 (diff) | |
download | gitlab-ce-ca6e946f0f50d997ecad7d3758fe362cf0fae5ce.tar.gz |
Only show message when MR is open60808-only-show-target-branch-advanced-error-before-merge
This commit fixes the bug that was causing the "target branch has
"advanced" error message to display after an MR was closed.
Diffstat (limited to 'spec/javascripts')
-rw-r--r-- | spec/javascripts/vue_mr_widget/mr_widget_options_spec.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/javascripts/vue_mr_widget/mr_widget_options_spec.js b/spec/javascripts/vue_mr_widget/mr_widget_options_spec.js index 690fcd3e224..a0628fdcebe 100644 --- a/spec/javascripts/vue_mr_widget/mr_widget_options_spec.js +++ b/spec/javascripts/vue_mr_widget/mr_widget_options_spec.js @@ -228,6 +228,7 @@ describe('mrWidgetOptions', () => { describe('showTargetBranchAdvancedError', () => { describe(`when the pipeline's target_sha property doesn't exist`, () => { beforeEach(done => { + Vue.set(vm.mr, 'isOpen', true); Vue.set(vm.mr.pipeline, 'target_sha', undefined); Vue.set(vm.mr, 'targetBranchSha', 'abcd'); vm.$nextTick(done); @@ -240,6 +241,7 @@ describe('mrWidgetOptions', () => { describe(`when the pipeline's target_sha matches the target branch's sha`, () => { beforeEach(done => { + Vue.set(vm.mr, 'isOpen', true); Vue.set(vm.mr.pipeline, 'target_sha', 'abcd'); Vue.set(vm.mr, 'targetBranchSha', 'abcd'); vm.$nextTick(done); @@ -250,8 +252,22 @@ describe('mrWidgetOptions', () => { }); }); + describe(`when the merge request is not open`, () => { + beforeEach(done => { + Vue.set(vm.mr, 'isOpen', false); + Vue.set(vm.mr.pipeline, 'target_sha', 'abcd'); + Vue.set(vm.mr, 'targetBranchSha', 'bcde'); + vm.$nextTick(done); + }); + + it('should be false', () => { + expect(vm.showTargetBranchAdvancedError).toEqual(false); + }); + }); + describe(`when the pipeline's target_sha does not match the target branch's sha`, () => { beforeEach(done => { + Vue.set(vm.mr, 'isOpen', true); Vue.set(vm.mr.pipeline, 'target_sha', 'abcd'); Vue.set(vm.mr, 'targetBranchSha', 'bcde'); vm.$nextTick(done); |