gitlab-org--gitlab-foss/spec/features/dashboard/shortcuts_spec.rb

62 lines
1.3 KiB
Ruby
Raw Normal View History

# frozen_string_literal: true
require 'spec_helper'
2018-07-05 02:32:05 -04:00
describe 'Dashboard shortcuts', :js do
context 'logged in' do
let(:user) { create(:user) }
let(:project) { create(:project) }
before do
project.add_developer(user)
sign_in(user)
visit root_dashboard_path
end
2018-07-05 02:32:05 -04:00
it 'Navigate to tabs' do
find('body').send_keys([:shift, 'I'])
check_page_title('Issues')
find('body').send_keys([:shift, 'M'])
check_page_title('Merge Requests')
find('body').send_keys([:shift, 'T'])
check_page_title('To-Do List')
find('body').send_keys([:shift, 'P'])
check_page_title('Projects')
end
end
context 'logged out' do
before do
visit explore_root_path
end
2018-07-05 02:32:05 -04:00
it 'Navigate to tabs' do
find('body').send_keys([:shift, 'G'])
find('.nothing-here-block')
expect(page).to have_content('No public groups')
find('body').send_keys([:shift, 'S'])
find('.nothing-here-block')
2019-02-22 07:12:36 -05:00
expect(page).to have_content('No snippets found')
find('body').send_keys([:shift, 'P'])
find('.nothing-here-block')
expect(page).to have_content('Explore public groups to find projects to contribute to.')
end
end
def check_page_title(title)
expect(find('.page-title')).to have_content(title)
end
end