summaryrefslogtreecommitdiff
path: root/spec/features/global_search_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-12-20 13:37:47 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-12-20 13:37:47 +0000
commitaee0a117a889461ce8ced6fcf73207fe017f1d99 (patch)
tree891d9ef189227a8445d83f35c1b0fc99573f4380 /spec/features/global_search_spec.rb
parent8d46af3258650d305f53b819eabf7ab18d22f59e (diff)
downloadgitlab-ce-aee0a117a889461ce8ced6fcf73207fe017f1d99.tar.gz
Add latest changes from gitlab-org/gitlab@14-6-stable-eev14.6.0-rc42
Diffstat (limited to 'spec/features/global_search_spec.rb')
-rw-r--r--spec/features/global_search_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/features/global_search_spec.rb b/spec/features/global_search_spec.rb
index a380edff3a4..0397e72502a 100644
--- a/spec/features/global_search_spec.rb
+++ b/spec/features/global_search_spec.rb
@@ -57,6 +57,14 @@ RSpec.describe 'Global search' do
expect(page).to have_selector('.search-form')
expect(page).to have_no_selector('#js-header-search')
end
+
+ it 'focuses search input when shortcut "s" is pressed', :js do
+ expect(page).not_to have_selector('#search:focus')
+
+ find('body').native.send_key('s')
+
+ expect(page).to have_selector('#search:focus')
+ end
end
describe 'when new_header_search feature is enabled' do
@@ -70,5 +78,13 @@ RSpec.describe 'Global search' do
expect(page).to have_no_selector('.search-form')
expect(page).to have_selector('#js-header-search')
end
+
+ it 'focuses search input when shortcut "s" is pressed', :js do
+ expect(page).not_to have_selector('#search:focus')
+
+ find('body').native.send_key('s')
+
+ expect(page).to have_selector('#search:focus')
+ end
end
end