diff options
Diffstat (limited to 'spec/features/projects/user_uses_shortcuts_spec.rb')
-rw-r--r-- | spec/features/projects/user_uses_shortcuts_spec.rb | 57 |
1 files changed, 2 insertions, 55 deletions
diff --git a/spec/features/projects/user_uses_shortcuts_spec.rb b/spec/features/projects/user_uses_shortcuts_spec.rb index 77f753b92eb..b7b2093d78a 100644 --- a/spec/features/projects/user_uses_shortcuts_spec.rb +++ b/spec/features/projects/user_uses_shortcuts_spec.rb @@ -3,9 +3,8 @@ require 'spec_helper' RSpec.describe 'User uses shortcuts', :js, feature_category: :groups_and_projects do - let_it_be(:project) { create(:project, :repository) } - - let(:user) { project.first_owner } + let_it_be(:user) { create(:user, :no_super_sidebar) } + let_it_be(:project) { create(:project, :repository, namespace: user.namespace) } before do sign_in(user) @@ -15,58 +14,6 @@ RSpec.describe 'User uses shortcuts', :js, feature_category: :groups_and_project wait_for_requests end - context 'disabling shortcuts' do - before do - page.evaluate_script("localStorage.removeItem('shortcutsDisabled')") - end - - it 'can disable shortcuts from help menu' do - open_modal_shortcut_keys - click_toggle_button - close_modal - - open_modal_shortcut_keys - - expect(page).not_to have_selector('[data-testid="modal-shortcuts"]') - - page.refresh - open_modal_shortcut_keys - - # after reload, shortcuts modal doesn't exist at all until we add it - expect(page).not_to have_selector('[data-testid="modal-shortcuts"]') - end - - it 're-enables shortcuts' do - open_modal_shortcut_keys - click_toggle_button - close_modal - - open_modal_from_help_menu - click_toggle_button - close_modal - - open_modal_shortcut_keys - expect(find('[data-testid="modal-shortcuts"]')).to be_visible - end - - def open_modal_shortcut_keys - find('body').native.send_key('?') - end - - def open_modal_from_help_menu - find('.header-help-dropdown-toggle').click - find('button', text: 'Keyboard shortcuts').click - end - - def click_toggle_button - find('.js-toggle-shortcuts .gl-toggle').click - end - - def close_modal - find('.modal button[aria-label="Close"]').click - end - end - context 'when navigating to the Project pages' do it 'redirects to the project overview page' do visit project_issues_path(project) |