diff options
author | Fatih Acet <acetfatih@gmail.com> | 2017-01-25 22:54:41 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2017-01-27 22:08:07 +0300 |
commit | b0aec417bf7c5b35817814d5946170f3a3b4966d (patch) | |
tree | c26a4a74f1e5defa22e63660d81f06c640ace8cc | |
parent | 8829bf186c1e2354dd613fa20cc6abb60e0f759e (diff) |
Merge branch 'label-select-toggle' into 'master'
Fixed label select toggle not updating correctly
Closes #26119
See merge request !8601
-rw-r--r-- | app/assets/javascripts/labels_select.js | 6 | ||||
-rw-r--r-- | changelogs/unreleased/label-select-toggle.yml | 4 | ||||
-rw-r--r-- | spec/features/issues/form_spec.rb | 16 |
3 files changed, 25 insertions, 1 deletions
diff --git a/app/assets/javascripts/labels_select.js b/app/assets/javascripts/labels_select.js index ec2fc87bece..4dbc82a73c4 100644 --- a/app/assets/javascripts/labels_select.js +++ b/app/assets/javascripts/labels_select.js @@ -336,7 +336,11 @@ .removeClass('is-active') } - if ($dropdown.hasClass('js-filter-bulk-update') || $dropdown.hasClass('js-issuable-form-dropdown')) { + if ($dropdown.hasClass('js-issuable-form-dropdown')) { + return; + } + + if ($dropdown.hasClass('js-filter-bulk-update')) { _this.enableBulkLabelDropdown(); _this.setDropdownData($dropdown, isMarking, this.id(label)); return; diff --git a/changelogs/unreleased/label-select-toggle.yml b/changelogs/unreleased/label-select-toggle.yml new file mode 100644 index 00000000000..af5b4246521 --- /dev/null +++ b/changelogs/unreleased/label-select-toggle.yml @@ -0,0 +1,4 @@ +--- +title: Fixed label dropdown toggle text not correctly updating +merge_request: +author: diff --git a/spec/features/issues/form_spec.rb b/spec/features/issues/form_spec.rb index 8771cc8e157..741ca95f1ca 100644 --- a/spec/features/issues/form_spec.rb +++ b/spec/features/issues/form_spec.rb @@ -68,6 +68,22 @@ describe 'New/edit issue', feature: true, js: true do end end end + + it 'correctly updates the dropdown toggle when removing a label' do + click_button 'Labels' + + page.within '.dropdown-menu-labels' do + click_link label.title + end + + expect(find('.js-label-select')).to have_content(label.title) + + page.within '.dropdown-menu-labels' do + click_link label.title + end + + expect(find('.js-label-select')).to have_content('Labels') + end end context 'edit issue' do |