2019-10-12 21:52:04 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
RSpec.describe 'Dashboard shortcuts', :js do
|
2021-10-27 15:23:28 +05:30
|
|
|
context 'logged in' do
|
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:project) { create(:project) }
|
2021-04-29 21:17:54 +05:30
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
before do
|
|
|
|
project.add_developer(user)
|
|
|
|
sign_in(user)
|
|
|
|
visit root_dashboard_path
|
|
|
|
end
|
2018-12-13 13:39:08 +05:30
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
it 'navigate to tabs' do
|
|
|
|
find('body').send_keys([:shift, 'I'])
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
check_page_title('Issues')
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
find('body').send_keys([:shift, 'M'])
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
check_page_title('Merge requests')
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
find('body').send_keys([:shift, 'T'])
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
check_page_title('To-Do List')
|
2017-09-10 17:25:29 +05:30
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
find('body').send_keys([:shift, 'G'])
|
2020-04-22 19:07:51 +05:30
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
check_page_title('Groups')
|
2020-04-22 19:07:51 +05:30
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
find('body').send_keys([:shift, 'P'])
|
2017-09-10 17:25:29 +05:30
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
check_page_title('Projects')
|
2020-04-22 19:07:51 +05:30
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
find('body').send_keys([:shift, 'A'])
|
2020-04-22 19:07:51 +05:30
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
check_page_title('Activity')
|
2021-09-04 01:27:46 +05:30
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
find('body').send_keys([:shift, 'L'])
|
2021-09-04 01:27:46 +05:30
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
check_page_title('Milestones')
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
2021-10-27 15:23:28 +05:30
|
|
|
end
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
context 'logged out' do
|
|
|
|
before do
|
|
|
|
visit explore_root_path
|
|
|
|
end
|
2021-06-08 01:23:25 +05:30
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
it 'navigate to tabs' do
|
|
|
|
find('body').send_keys([:shift, 'G'])
|
2021-06-08 01:23:25 +05:30
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
find('.nothing-here-block')
|
|
|
|
expect(page).to have_content('No public groups')
|
2021-06-08 01:23:25 +05:30
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
find('body').send_keys([:shift, 'S'])
|
2021-06-08 01:23:25 +05:30
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
find('.nothing-here-block')
|
|
|
|
expect(page).to have_content('No snippets found')
|
2021-06-08 01:23:25 +05:30
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
find('body').send_keys([:shift, 'P'])
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
find('.nothing-here-block')
|
|
|
|
expect(page).to have_content('Explore public groups to find projects to contribute to.')
|
2021-06-08 01:23:25 +05:30
|
|
|
end
|
|
|
|
end
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
def check_page_title(title)
|
|
|
|
expect(find('.page-title')).to have_content(title)
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
|
|
|
end
|