diff options
author | Phil Hughes <me@iamphill.com> | 2016-10-17 16:55:34 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-10-17 16:55:34 +0100 |
commit | f91df171c53f230937b538ffdec04d12f7726ffc (patch) | |
tree | 9e2bd7ed479f45c9ba9dcd0733803affd181d73d /spec/features | |
parent | 77507df6030dad9e317e092c70003d4c85d8f889 (diff) | |
download | gitlab-ce-f91df171c53f230937b538ffdec04d12f7726ffc.tar.gz |
Fixed find file keyboard navigationfind-file-enter-fix
Closes #23423
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/projects/files/find_file_keyboard_spec.rb | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/spec/features/projects/files/find_file_keyboard_spec.rb b/spec/features/projects/files/find_file_keyboard_spec.rb new file mode 100644 index 00000000000..fc88fd74af8 --- /dev/null +++ b/spec/features/projects/files/find_file_keyboard_spec.rb @@ -0,0 +1,42 @@ +require 'spec_helper' + +feature 'Find file keyboard shortcuts', feature: true, js: true do + include WaitForAjax + + let(:user) { create(:user) } + let(:project) { create(:project) } + + before do + project.team << [user, :master] + login_as user + + visit namespace_project_find_file_path(project.namespace, project, project.repository.root_ref) + + wait_for_ajax + end + + it 'opens file when pressing enter key' do + fill_in 'file_find', with: 'CHANGELOG' + + find('#file_find').native.send_keys(:enter) + + expect(page).to have_selector('.blob-content-holder') + + page.within('.file-title') do + expect(page).to have_content('CHANGELOG') + end + end + + it 'navigates files with arrow keys' do + fill_in 'file_find', with: 'application.' + + find('#file_find').native.send_keys(:down) + find('#file_find').native.send_keys(:enter) + + expect(page).to have_selector('.blob-content-holder') + + page.within('.file-title') do + expect(page).to have_content('application.js') + end + end +end |