summaryrefslogtreecommitdiff
path: root/spec/features
diff options
context:
space:
mode:
authorJacob Schatz <jschatz@gitlab.com>2017-01-25 04:29:16 +0000
committerJacob Schatz <jschatz@gitlab.com>2017-01-25 04:29:16 +0000
commita84656fcadac7339853bfa591bc132c68be3a363 (patch)
tree05e2e89b237a7394eb39ad9de79f628717ce752d /spec/features
parent1e2a9604673b7b4e94d2612606fbf1b16e08a20d (diff)
parent203db3cf8fa61b9188583cae0ce0b6b4ebc1998c (diff)
downloadgitlab-ce-a84656fcadac7339853bfa591bc132c68be3a363.tar.gz
Merge branch 'filtered-search-keyboard-navigation' into 'master'
Fixed keyboard navigation not working in filtered search bar Closes #26840 See merge request !8656
Diffstat (limited to 'spec/features')
-rw-r--r--spec/features/issues/filtered_search/dropdown_label_spec.rb10
-rw-r--r--spec/features/issues/filtered_search/search_bar_spec.rb16
2 files changed, 26 insertions, 0 deletions
diff --git a/spec/features/issues/filtered_search/dropdown_label_spec.rb b/spec/features/issues/filtered_search/dropdown_label_spec.rb
index bea00160f96..71e0608a664 100644
--- a/spec/features/issues/filtered_search/dropdown_label_spec.rb
+++ b/spec/features/issues/filtered_search/dropdown_label_spec.rb
@@ -40,6 +40,16 @@ describe 'Dropdown label', js: true, feature: true do
visit namespace_project_issues_path(project.namespace, project)
end
+ describe 'keyboard navigation' do
+ it 'selects label' do
+ send_keys_to_filtered_search('label:')
+
+ filtered_search.native.send_keys(:down, :down, :enter)
+
+ expect(filtered_search.value).to eq("label:~#{special_label.name}")
+ end
+ end
+
describe 'behavior' do
it 'opens when the search bar has label:' do
filtered_search.set('label:')
diff --git a/spec/features/issues/filtered_search/search_bar_spec.rb b/spec/features/issues/filtered_search/search_bar_spec.rb
index 56b1d354eb0..90eb60eb337 100644
--- a/spec/features/issues/filtered_search/search_bar_spec.rb
+++ b/spec/features/issues/filtered_search/search_bar_spec.rb
@@ -20,6 +20,22 @@ describe 'Search bar', js: true, feature: true do
left_style.to_s.gsub('left: ', '').to_f
end
+ describe 'keyboard navigation' do
+ it 'makes item active' do
+ filtered_search.native.send_keys(:down)
+
+ page.within '#js-dropdown-hint' do
+ expect(page).to have_selector('.dropdown-active')
+ end
+ end
+
+ it 'selects item' do
+ filtered_search.native.send_keys(:down, :down, :enter)
+
+ expect(filtered_search.value).to eq('author:')
+ end
+ end
+
describe 'clear search button' do
it 'clears text' do
search_text = 'search_text'