From 9181e4b135053140fe61f785603eb8101f4534f1 Mon Sep 17 00:00:00 2001 From: Luke Bennett Date: Fri, 24 May 2019 20:20:05 +0100 Subject: Fix search dropdown not closing on blur if empty --- spec/features/global_search_spec.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'spec/features/global_search_spec.rb') 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 -- cgit v1.2.1