Commit 248c06a0 authored by Jacob Schatz's avatar Jacob Schatz

Merge branch 'signed-out-menu-shortcuts' into 'master'

Added keyboard shortcuts to signed out menu

See merge request !10526
parents 862b74bc 195c058c
%ul %ul
= nav_link(path: ['dashboard#show', 'root#show', 'projects#trending', 'projects#starred', 'projects#index'], html_options: {class: 'home'}) do = nav_link(path: ['dashboard#show', 'root#show', 'projects#trending', 'projects#starred', 'projects#index'], html_options: {class: 'home'}) do
= link_to explore_root_path, title: 'Projects' do = link_to explore_root_path, title: 'Projects', class: 'dashboard-shortcuts-projects' do
.shortcut-mappings
.key
= icon('arrow-up', 'aria-label' => 'hidden')
P
%span %span
Projects Projects
= nav_link(controller: [:groups, 'groups/milestones', 'groups/group_members']) do = nav_link(controller: [:groups, 'groups/milestones', 'groups/group_members']) do
= link_to explore_groups_path, title: 'Groups' do = link_to explore_groups_path, title: 'Groups', class: 'dashboard-shortcuts-groups' do
.shortcut-mappings
.key
= icon('arrow-up', 'aria-label' => 'hidden')
G
%span %span
Groups Groups
= nav_link(controller: :snippets) do = nav_link(controller: :snippets) do
= link_to explore_snippets_path, title: 'Snippets' do = link_to explore_snippets_path, title: 'Snippets', class: 'dashboard-shortcuts-snippets' do
.shortcut-mappings
.key
= icon('arrow-up', 'aria-label' => 'hidden')
S
%span %span
Snippets Snippets
%li.divider
= nav_link(controller: :help) do = nav_link(controller: :help) do
= link_to help_path, title: 'Help' do = link_to help_path, title: 'Help' do
%span %span
......
require 'spec_helper' require 'spec_helper'
feature 'Dashboard shortcuts', feature: true, js: true do feature 'Dashboard shortcuts', feature: true, js: true do
context 'logged in' do
before do before do
login_as :user login_as :user
visit root_dashboard_path visit root_dashboard_path
...@@ -23,6 +24,27 @@ feature 'Dashboard shortcuts', feature: true, js: true do ...@@ -23,6 +24,27 @@ feature 'Dashboard shortcuts', feature: true, js: true do
check_page_title('Todos') check_page_title('Todos')
end end
end
context 'logged out' do
before do
visit explore_root_path
end
scenario 'Navigate to tabs' do
find('body').native.send_keys([:shift, 'P'])
expect(page).to have_content('No projects found')
find('body').native.send_keys([:shift, 'G'])
expect(page).to have_content('No public groups')
find('body').native.send_keys([:shift, 'S'])
expect(page).to have_selector('.snippets-list-holder')
end
end
def check_page_title(title) def check_page_title(title)
expect(find('.header-content .title')).to have_content(title) expect(find('.header-content .title')).to have_content(title)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment