diff options
author | Tim Zallmann <tzallmann@gitlab.com> | 2017-11-12 07:32:26 +0000 |
---|---|---|
committer | Tim Zallmann <tzallmann@gitlab.com> | 2017-11-12 07:32:26 +0000 |
commit | 111faddc50fa2cdf12988b68c3f4e3660f3139a8 (patch) | |
tree | 6e4a8205b233e19be08f0c85477e9b654461d209 | |
parent | d180affa210bd6e5474746bcfed006cee9d3730e (diff) | |
parent | fdf635c03c2621fe36eba5691c1ab8b1a51f1081 (diff) | |
download | gitlab-ce-111faddc50fa2cdf12988b68c3f4e3660f3139a8.tar.gz |
Merge branch '39564-clear-filter-on-gitlab-dropdown-open' into 'master'
Clear filter on gl_dropdown open
Closes #39564
See merge request gitlab-org/gitlab-ce!15214
-rw-r--r-- | app/assets/javascripts/gl_dropdown.js | 2 | ||||
-rw-r--r-- | spec/features/merge_requests/create_new_mr_spec.rb | 22 |
2 files changed, 23 insertions, 1 deletions
diff --git a/app/assets/javascripts/gl_dropdown.js b/app/assets/javascripts/gl_dropdown.js index c4202f92443..4e7a6e54f90 100644 --- a/app/assets/javascripts/gl_dropdown.js +++ b/app/assets/javascripts/gl_dropdown.js @@ -331,7 +331,7 @@ GitLabDropdown = (function() { if (_this.dropdown.find('.dropdown-toggle-page').length) { selector = ".dropdown-page-one " + selector; } - return $(selector); + return $(selector, this.instance.dropdown); }; })(this), data: (function(_this) { diff --git a/spec/features/merge_requests/create_new_mr_spec.rb b/spec/features/merge_requests/create_new_mr_spec.rb index 5402d61da54..db5ce2d11a8 100644 --- a/spec/features/merge_requests/create_new_mr_spec.rb +++ b/spec/features/merge_requests/create_new_mr_spec.rb @@ -67,6 +67,28 @@ feature 'Create New Merge Request', :js do expect(page).to have_content 'git checkout -b orphaned-branch origin/orphaned-branch' end + it 'allows filtering multiple dropdowns' do + visit project_new_merge_request_path(project) + + first('.js-source-branch').click + + input = find('.dropdown-source-branch .dropdown-input-field') + input.click + input.send_keys('orphaned-branch') + + find('.dropdown-source-branch .dropdown-content li', match: :first) + source_items = all('.dropdown-source-branch .dropdown-content li') + + expect(source_items.count).to eq(1) + + first('.js-target-branch').click + + find('.dropdown-target-branch .dropdown-content li', match: :first) + target_items = all('.dropdown-target-branch .dropdown-content li') + + expect(target_items.count).to be > 1 + end + context 'when target project cannot be viewed by the current user' do it 'does not leak the private project name & namespace' do private_project = create(:project, :private, :repository) |