diff options
author | Jacob Schatz <jschatz@gitlab.com> | 2016-08-05 19:42:31 +0300 |
---|---|---|
committer | Jacob Schatz <jschatz@gitlab.com> | 2016-08-05 19:42:31 +0300 |
commit | 8765d2f9ca94533c69edc90e41fc25fa5e98e018 (patch) | |
tree | 0a58c42f9c823e83c7939fc2c33d0cf579824417 /spec/features | |
parent | 3e687315e0c42ad24ca2ced832dd2121876625b7 (diff) | |
parent | 4d716b765c66d51aa8026ce8622d704c2d52844a (diff) |
Merge branch 'ref-switcher-enter-submit' into 'master'
Fixed enter submitting form in dropdown
## What does this MR do?
When searching for a branch in the ref switcher & then pressing enter it would submit the form without anything. This instead doesn't submit the form without anything being selected in the dropdown.
Also improved the UX by making it submit with `Turoblinks` as currently no loading bar is shown so the user has no idea if anything is happening.
## What are the relevant issue numbers?
Closes #19549
See merge request !5111
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/projects/ref_switcher_spec.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/features/projects/ref_switcher_spec.rb b/spec/features/projects/ref_switcher_spec.rb new file mode 100644 index 00000000000..b3ba40b35af --- /dev/null +++ b/spec/features/projects/ref_switcher_spec.rb @@ -0,0 +1,29 @@ +require 'rails_helper' + +feature 'Ref switcher', feature: true, js: true do + include WaitForAjax + let(:user) { create(:user) } + let(:project) { create(:project, :public) } + + before do + project.team << [user, :master] + login_as(user) + visit namespace_project_tree_path(project.namespace, project, 'master') + end + + it 'allow user to change ref by enter key' do + click_button 'master' + wait_for_ajax + + page.within '.project-refs-form' do + input = find('input[type="search"]') + input.set 'expand' + + input.native.send_keys :down + input.native.send_keys :down + input.native.send_keys :enter + + expect(page).to have_content 'expand-collapse-files' + end + end +end |