diff options
Diffstat (limited to 'spec/features/projects/user_uses_shortcuts_spec.rb')
-rw-r--r-- | spec/features/projects/user_uses_shortcuts_spec.rb | 67 |
1 files changed, 57 insertions, 10 deletions
diff --git a/spec/features/projects/user_uses_shortcuts_spec.rb b/spec/features/projects/user_uses_shortcuts_spec.rb index b6fde19e0d4..1350ecf6e75 100644 --- a/spec/features/projects/user_uses_shortcuts_spec.rb +++ b/spec/features/projects/user_uses_shortcuts_spec.rb @@ -68,14 +68,27 @@ RSpec.describe 'User uses shortcuts', :js do end context 'when navigating to the Project pages' do - it 'redirects to the details page' do + it 'redirects to the project page' do visit project_issues_path(project) find('body').native.send_key('g') find('body').native.send_key('p') expect(page).to have_active_navigation('Project') - expect(page).to have_active_sub_navigation('Details') + end + + context 'when feature flag :sidebar_refactor is disabled' do + it 'redirects to the details page' do + stub_feature_flags(sidebar_refactor: false) + + visit project_issues_path(project) + + find('body').native.send_key('g') + find('body').native.send_key('p') + + expect(page).to have_active_navigation('Project') + expect(page).to have_active_sub_navigation('Details') + end end it 'redirects to the activity page' do @@ -165,28 +178,62 @@ RSpec.describe 'User uses shortcuts', :js do end end - context 'when navigating to the Operations pages' do + context 'when navigating to the Deployments page' do + it 'redirects to the Environments page' do + find('body').native.send_key('g') + find('body').native.send_key('e') + + expect(page).to have_active_navigation('Deployments') + expect(page).to have_active_sub_navigation('Environments') + end + end + + context 'when navigating to the Monitor pages' do it 'redirects to the Metrics page' do find('body').native.send_key('g') find('body').native.send_key('l') - expect(page).to have_active_navigation('Operations') + expect(page).to have_active_navigation('Monitor') expect(page).to have_active_sub_navigation('Metrics') end - it 'redirects to the Environments page' do - find('body').native.send_key('g') - find('body').native.send_key('e') + context 'when feature flag :sidebar_refactor is disabled' do + before do + stub_feature_flags(sidebar_refactor: false) + end - expect(page).to have_active_navigation('Operations') - expect(page).to have_active_sub_navigation('Environments') + it 'redirects to the Operations page' do + find('body').native.send_key('g') + find('body').native.send_key('l') + + expect(page).to have_active_navigation('Operations') + expect(page).to have_active_sub_navigation('Metrics') + end + + it 'redirects to the Kubernetes page with active Operations' do + find('body').native.send_key('g') + find('body').native.send_key('k') + + expect(page).to have_active_navigation('Operations') + expect(page).to have_active_sub_navigation('Kubernetes') + end + + it 'redirects to the Environments page' do + find('body').native.send_key('g') + find('body').native.send_key('e') + + expect(page).to have_active_navigation('Operations') + expect(page).to have_active_sub_navigation('Environments') + end end + end + context 'when navigating to the Infrastructure pages' do it 'redirects to the Kubernetes page' do find('body').native.send_key('g') find('body').native.send_key('k') - expect(page).to have_active_navigation('Operations') + expect(page).to have_active_navigation('Infrastructure') expect(page).to have_active_sub_navigation('Kubernetes') end end |