Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Bennett <lbennett@gitlab.com>2019-05-24 22:20:05 +0300
committerLuke Bennett <lbennett@gitlab.com>2019-05-31 16:40:00 +0300
commit9181e4b135053140fe61f785603eb8101f4534f1 (patch)
tree3093be29ed92c168eb54bd99f440facc5a48a585 /spec/features/global_search_spec.rb
parent12aff0b73cacf533533d584d68307b1b6a030cee (diff)
Fix search dropdown not closing on blur if empty
Diffstat (limited to 'spec/features/global_search_spec.rb')
-rw-r--r--spec/features/global_search_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/features/global_search_spec.rb b/spec/features/global_search_spec.rb
index d7692181453..f2ab5373d3d 100644
--- a/spec/features/global_search_spec.rb
+++ b/spec/features/global_search_spec.rb
@@ -25,4 +25,18 @@ describe 'Global search' do
expect(page).to have_selector('.gl-pagination .next')
end
end
+
+ it 'closes the dropdown on blur', :js do
+ visit dashboard_projects_path
+
+ fill_in 'search', with: "a"
+ dropdown = find('.js-dashboard-search-options')
+
+ expect(dropdown[:class]).to include 'show'
+
+ find('#search').send_keys(:backspace)
+ find('body').click
+
+ expect(dropdown[:class]).not_to include 'show'
+ end
end