2019-07-25 01:24:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-01-31 05:05:50 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-16 14:09:01 -04:00
|
|
|
RSpec.describe 'Dashboard shortcuts', :js do
|
2017-04-07 04:46:31 -04:00
|
|
|
context 'logged in' do
|
2018-10-06 10:21:38 -04:00
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:project) { create(:project) }
|
|
|
|
|
2017-04-07 04:46:31 -04:00
|
|
|
before do
|
2018-10-06 10:21:38 -04:00
|
|
|
project.add_developer(user)
|
|
|
|
sign_in(user)
|
2017-04-07 04:46:31 -04:00
|
|
|
visit root_dashboard_path
|
|
|
|
end
|
|
|
|
|
2020-12-09 13:09:48 -05:00
|
|
|
it 'navigate to tabs' do
|
2017-05-10 11:53:11 -04:00
|
|
|
find('body').send_keys([:shift, 'I'])
|
2017-04-07 04:46:31 -04:00
|
|
|
|
|
|
|
check_page_title('Issues')
|
2017-01-31 05:05:50 -05:00
|
|
|
|
2017-05-10 11:53:11 -04:00
|
|
|
find('body').send_keys([:shift, 'M'])
|
2017-04-07 04:46:31 -04:00
|
|
|
|
|
|
|
check_page_title('Merge Requests')
|
|
|
|
|
2017-05-10 11:09:36 -04:00
|
|
|
find('body').send_keys([:shift, 'T'])
|
2017-04-07 04:46:31 -04:00
|
|
|
|
2019-07-04 11:45:54 -04:00
|
|
|
check_page_title('To-Do List')
|
2017-05-10 11:09:36 -04:00
|
|
|
|
2020-04-14 17:09:52 -04:00
|
|
|
find('body').send_keys([:shift, 'G'])
|
|
|
|
|
|
|
|
check_page_title('Groups')
|
|
|
|
|
2017-05-10 11:09:36 -04:00
|
|
|
find('body').send_keys([:shift, 'P'])
|
|
|
|
|
|
|
|
check_page_title('Projects')
|
2020-04-09 08:09:24 -04:00
|
|
|
|
|
|
|
find('body').send_keys([:shift, 'A'])
|
|
|
|
|
|
|
|
check_page_title('Activity')
|
2017-04-07 04:46:31 -04:00
|
|
|
end
|
|
|
|
end
|
2017-01-31 05:05:50 -05:00
|
|
|
|
2017-04-07 04:46:31 -04:00
|
|
|
context 'logged out' do
|
|
|
|
before do
|
|
|
|
visit explore_root_path
|
|
|
|
end
|
2017-01-31 05:05:50 -05:00
|
|
|
|
2020-12-09 13:09:48 -05:00
|
|
|
it 'navigate to tabs' do
|
2017-05-10 11:09:36 -04:00
|
|
|
find('body').send_keys([:shift, 'G'])
|
2017-01-31 05:05:50 -05:00
|
|
|
|
2017-05-10 11:09:36 -04:00
|
|
|
find('.nothing-here-block')
|
2017-04-07 04:46:31 -04:00
|
|
|
expect(page).to have_content('No public groups')
|
2017-03-17 06:58:19 -04:00
|
|
|
|
2017-05-10 11:09:36 -04:00
|
|
|
find('body').send_keys([:shift, 'S'])
|
2017-03-17 06:58:19 -04:00
|
|
|
|
2017-05-10 11:09:36 -04:00
|
|
|
find('.nothing-here-block')
|
2019-02-22 07:12:36 -05:00
|
|
|
expect(page).to have_content('No snippets found')
|
2017-05-10 11:09:36 -04:00
|
|
|
|
|
|
|
find('body').send_keys([:shift, 'P'])
|
|
|
|
|
|
|
|
find('.nothing-here-block')
|
2020-11-06 10:09:14 -05:00
|
|
|
expect(page).to have_content('Explore public groups to find projects to contribute to.')
|
2017-04-07 04:46:31 -04:00
|
|
|
end
|
2017-01-31 05:05:50 -05:00
|
|
|
end
|
|
|
|
|
2017-02-14 18:43:03 -05:00
|
|
|
def check_page_title(title)
|
2018-10-06 10:21:38 -04:00
|
|
|
expect(find('.page-title')).to have_content(title)
|
2017-01-31 05:05:50 -05:00
|
|
|
end
|
2017-05-10 11:53:11 -04:00
|
|
|
end
|