2016-10-17 11:55:34 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-10-03 04:35:01 -04:00
|
|
|
feature 'Find file keyboard shortcuts', :js do
|
2016-10-17 11:55:34 -04:00
|
|
|
let(:user) { create(:user) }
|
2017-07-24 18:51:14 -04:00
|
|
|
let(:project) { create(:project, :repository) }
|
2016-10-17 11:55:34 -04:00
|
|
|
|
|
|
|
before do
|
|
|
|
project.team << [user, :master]
|
2017-06-21 19:44:10 -04:00
|
|
|
sign_in user
|
2016-10-17 11:55:34 -04:00
|
|
|
|
2017-07-06 12:20:50 -04:00
|
|
|
visit project_find_file_path(project, project.repository.root_ref)
|
2016-10-17 11:55:34 -04:00
|
|
|
|
2017-05-17 14:25:13 -04:00
|
|
|
wait_for_requests
|
2016-10-17 11:55:34 -04:00
|
|
|
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')
|
|
|
|
|
2017-02-05 17:28:48 -05:00
|
|
|
page.within('.js-file-title') do
|
2016-10-17 11:55:34 -04:00
|
|
|
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')
|
|
|
|
|
2017-02-05 17:28:48 -05:00
|
|
|
page.within('.js-file-title') do
|
2016-10-17 11:55:34 -04:00
|
|
|
expect(page).to have_content('application.js')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|