Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/admin/admin_mode/logout_spec.rb')
-rw-r--r--spec/features/admin/admin_mode/logout_spec.rb31
1 files changed, 17 insertions, 14 deletions
diff --git a/spec/features/admin/admin_mode/logout_spec.rb b/spec/features/admin/admin_mode/logout_spec.rb
index 664eb51e58f..efb4baa8164 100644
--- a/spec/features/admin/admin_mode/logout_spec.rb
+++ b/spec/features/admin/admin_mode/logout_spec.rb
@@ -5,28 +5,32 @@ require 'spec_helper'
RSpec.describe 'Admin Mode Logout', :js do
include TermsHelper
include UserLoginHelper
+ include Spec::Support::Helpers::Features::TopNavSpecHelpers
let(:user) { create(:admin) }
shared_examples 'combined_menu: feature flag examples' do
before do
- gitlab_sign_in(user)
+ # TODO: This used to use gitlab_sign_in, instead of sign_in, but that is buggy. See
+ # this issue to look into why: https://gitlab.com/gitlab-org/gitlab/-/issues/331851
+ sign_in(user)
gitlab_enable_admin_mode_sign_in(user)
visit admin_root_path
end
it 'disable removes admin mode and redirects to root page' do
- pending_on_combined_menu_flag
-
gitlab_disable_admin_mode
expect(current_path).to eq root_path
- expect(page).to have_link(href: new_admin_session_path)
+
+ open_top_nav
+
+ within_top_nav do
+ expect(page).to have_link(href: new_admin_session_path)
+ end
end
it 'disable shows flash notice' do
- pending_on_combined_menu_flag
-
gitlab_disable_admin_mode
expect(page).to have_selector('.flash-notice')
@@ -38,17 +42,20 @@ RSpec.describe 'Admin Mode Logout', :js do
end
it 'disable removes admin mode and redirects to root page' do
- pending_on_combined_menu_flag
-
gitlab_disable_admin_mode
expect(current_path).to eq root_path
- expect(page).to have_link(href: new_admin_session_path)
+
+ open_top_nav
+
+ within_top_nav do
+ expect(page).to have_link(href: new_admin_session_path)
+ end
end
end
end
- context 'with combined_menu: feature flag on' do
+ context 'with combined_menu feature flag on' do
let(:needs_rewrite_for_combined_menu_flag_on) { true }
before do
@@ -67,8 +74,4 @@ RSpec.describe 'Admin Mode Logout', :js do
it_behaves_like 'combined_menu: feature flag examples'
end
-
- def pending_on_combined_menu_flag
- pending 'https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56587' if needs_rewrite_for_combined_menu_flag_on
- end
end