diff options
author | Natalia Tepluhina <ntepluhina@gitlab.com> | 2019-03-07 12:26:31 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2019-03-07 12:26:31 +0300 |
commit | 52c772f9c3055e599eb05530f9acb6648696d1fb (patch) | |
tree | b9a957be24c01ed4a3c5d972626959e2cd5f9bb5 /spec | |
parent | 5a82810faf5dbb0ad8a810c494fba1cea74456de (diff) |
Added a condition on squash message display
- also added a caret back to GlDropdown
Diffstat (limited to 'spec')
-rw-r--r-- | spec/javascripts/vue_mr_widget/components/states/mr_widget_ready_to_merge_spec.js | 20 |
1 files changed, 17 insertions, 3 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 631da202d1d..08e173b0a10 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 @@ -673,7 +673,7 @@ describe('ReadyToMerge', () => { .at(0) .props('label'); - it('should have two edit components when squash is enabled', () => { + it('should have two edit components when squash is enabled and there is more than 1 commit', () => { createLocalComponent({ mr: { commitsCount: 2, @@ -685,6 +685,18 @@ describe('ReadyToMerge', () => { expect(findCommitEditElements().length).toBe(2); }); + it('should have one edit components when squash is enabled and there is 1 commit only', () => { + createLocalComponent({ + mr: { + commitsCount: 1, + squash: true, + enableSquashBeforeMerge: true, + }, + }); + + expect(findCommitEditElements().length).toBe(1); + }); + it('should have correct edit merge commit label', () => { createLocalComponent(); @@ -711,8 +723,10 @@ describe('ReadyToMerge', () => { expect(findCommitDropdownElement().exists()).toBeFalsy(); }); - it('should be rendered if squash is enabled', () => { - createLocalComponent({ mr: { squash: true } }); + it('should be rendered if squash is enabled and there is more than 1 commit', () => { + createLocalComponent({ + mr: { enableSquashBeforeMerge: true, squash: true, commitsCount: 2 }, + }); expect(findCommitDropdownElement().exists()).toBeTruthy(); }); |