diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-27 12:07:37 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-27 12:07:37 +0300 |
commit | 59026a49b3affb3c6c3bc6ecc67b20c811623e70 (patch) | |
tree | 18c1e9b62b10daac81b83a9ab42f0bfcca0dfd33 /spec/javascripts | |
parent | f772bfe30596265c0ee7de7970e821352e764e0c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/javascripts')
-rw-r--r-- | spec/javascripts/vue_mr_widget/components/states/mr_widget_ready_to_merge_spec.js | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/spec/javascripts/vue_mr_widget/components/states/mr_widget_ready_to_merge_spec.js b/spec/javascripts/vue_mr_widget/components/states/mr_widget_ready_to_merge_spec.js index a2fa098bf6b..6c44ffc6ec9 100644 --- a/spec/javascripts/vue_mr_widget/components/states/mr_widget_ready_to_merge_spec.js +++ b/spec/javascripts/vue_mr_widget/components/states/mr_widget_ready_to_merge_spec.js @@ -634,20 +634,18 @@ describe('ReadyToMerge', () => { }); describe('when user can merge and can delete branch', () => { - let customVm; - beforeEach(() => { - customVm = createComponent({ + vm = createComponent({ mr: { canRemoveSourceBranch: true }, }); }); it('isRemoveSourceBranchButtonDisabled should be false', () => { - expect(customVm.isRemoveSourceBranchButtonDisabled).toBe(false); + expect(vm.isRemoveSourceBranchButtonDisabled).toBe(false); }); - it('should be enabled in rendered output', () => { - const checkboxElement = customVm.$el.querySelector('#remove-source-branch-input'); + it('removed source branch should be enabled in rendered output', () => { + const checkboxElement = vm.$el.querySelector('#remove-source-branch-input'); expect(checkboxElement).not.toBeNull(); }); @@ -926,22 +924,36 @@ describe('ReadyToMerge', () => { }); describe('Commit message area', () => { - it('when using merge commits, should show "Modify commit message" button', () => { - const customVm = createComponent({ - mr: { ffOnlyEnabled: false }, + describe('when using merge commits', () => { + beforeEach(() => { + vm = createComponent({ + mr: { ffOnlyEnabled: false }, + }); + }); + + it('should not show fast forward message', () => { + expect(vm.$el.querySelector('.mr-fast-forward-message')).toBeNull(); }); - expect(customVm.$el.querySelector('.mr-fast-forward-message')).toBeNull(); - expect(customVm.$el.querySelector('.js-modify-commit-message-button')).toBeDefined(); + it('should show "Modify commit message" button', () => { + expect(vm.$el.querySelector('.js-modify-commit-message-button')).toBeDefined(); + }); }); - it('when fast-forward merge is enabled, only show fast-forward message', () => { - const customVm = createComponent({ - mr: { ffOnlyEnabled: true }, + describe('when fast-forward merge is enabled', () => { + beforeEach(() => { + vm = createComponent({ + mr: { ffOnlyEnabled: true }, + }); + }); + + it('should show fast forward message', () => { + expect(vm.$el.querySelector('.mr-fast-forward-message')).toBeDefined(); }); - expect(customVm.$el.querySelector('.mr-fast-forward-message')).toBeDefined(); - expect(customVm.$el.querySelector('.js-modify-commit-message-button')).toBeNull(); + it('should not show "Modify commit message" button', () => { + expect(vm.$el.querySelector('.js-modify-commit-message-button')).toBeNull(); + }); }); }); |