diff options
author | Harry Kiselev <harry.kiselev@gmail.com> | 2018-12-25 23:41:32 +0300 |
---|---|---|
committer | Harry Kiselev <harry.kiselev@gmail.com> | 2018-12-25 23:41:32 +0300 |
commit | c01444a79bc1d1dc1576b1d1e71680b27199f48d (patch) | |
tree | 7d1cfcca3739e4b42ebf35d07af9bc914f4342fa /spec/javascripts | |
parent | 5dc656fc1f053d397ad1e6c1d85a815f03a5d634 (diff) | |
download | gitlab-ce-c01444a79bc1d1dc1576b1d1e71680b27199f48d.tar.gz |
Update condition to visibility collaboration status text, #44642.
Diffstat (limited to 'spec/javascripts')
-rw-r--r-- | spec/javascripts/vue_mr_widget/mr_widget_options_spec.js | 47 |
1 files changed, 47 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 f72bf627c10..47198d069ee 100644 --- a/spec/javascripts/vue_mr_widget/mr_widget_options_spec.js +++ b/spec/javascripts/vue_mr_widget/mr_widget_options_spec.js @@ -132,6 +132,53 @@ describe('mrWidgetOptions', () => { expect(vm.shouldRenderSourceBranchRemovalStatus).toEqual(false); }); }); + + describe('shouldRenderCollaborationStatus', () => { + describe('when collaboration is allowed', () => { + beforeEach(() => { + vm.mr.allowCollaboration = true; + }); + + describe('when merge request is opened', () => { + beforeEach(done => { + vm.mr.isOpen = true; + vm.$nextTick(done); + }); + + it('should render collaboration status', () => { + expect(vm.$el.textContent).toContain('Allows commits from members'); + }); + }); + + describe('when merge request is not opened', () => { + beforeEach(done => { + vm.mr.isOpen = false; + vm.$nextTick(done); + }); + + it('should not render collaboration status', () => { + expect(vm.$el.textContent).not.toContain('Allows commits from members'); + }); + }); + }); + + describe('when collaboration is not allowed', () => { + beforeEach(() => { + vm.mr.allowCollaboration = false; + }); + + describe('when merge request is opened', () => { + beforeEach(done => { + vm.mr.isOpen = true; + vm.$nextTick(done); + }); + + it('should not render collaboration status', () => { + expect(vm.$el.textContent).not.toContain('Allows commits from members'); + }); + }); + }); + }); }); describe('methods', () => { |