diff options
Diffstat (limited to 'spec/features/dashboard/group_dashboard_with_external_authorization_service_spec.rb')
-rw-r--r-- | spec/features/dashboard/group_dashboard_with_external_authorization_service_spec.rb | 74 |
1 files changed, 51 insertions, 23 deletions
diff --git a/spec/features/dashboard/group_dashboard_with_external_authorization_service_spec.rb b/spec/features/dashboard/group_dashboard_with_external_authorization_service_spec.rb index 179d9d09905..0620f819332 100644 --- a/spec/features/dashboard/group_dashboard_with_external_authorization_service_spec.rb +++ b/spec/features/dashboard/group_dashboard_with_external_authorization_service_spec.rb @@ -7,36 +7,64 @@ RSpec.describe 'The group dashboard' do let(:user) { create(:user) } - before do - stub_feature_flags(combined_menu: false) + shared_examples 'combined_menu: feature flag examples' do + before do + sign_in user + end - sign_in user - end + describe 'The top navigation' do + it 'has all the expected links' do + pending_on_combined_menu_flag - describe 'The top navigation' do - it 'has all the expected links' do - visit dashboard_groups_path + visit dashboard_groups_path - within('.navbar') do - expect(page).to have_button('Projects') - expect(page).to have_button('Groups') - expect(page).to have_link('Activity') - expect(page).to have_link('Milestones') - expect(page).to have_link('Snippets') + within('.navbar') do + expect(page).to have_button('Projects') + expect(page).to have_button('Groups') + expect(page).to have_link('Activity') + expect(page).to have_link('Milestones') + expect(page).to have_link('Snippets') + end end - end - it 'hides some links when an external authorization service is enabled' do - enable_external_authorization_service_check - visit dashboard_groups_path + it 'hides some links when an external authorization service is enabled' do + pending_on_combined_menu_flag + + enable_external_authorization_service_check + visit dashboard_groups_path - within('.navbar') do - expect(page).to have_button('Projects') - expect(page).to have_button('Groups') - expect(page).not_to have_link('Activity') - expect(page).not_to have_link('Milestones') - expect(page).to have_link('Snippets') + within('.navbar') do + expect(page).to have_button('Projects') + expect(page).to have_button('Groups') + expect(page).not_to have_link('Activity') + expect(page).not_to have_link('Milestones') + expect(page).to have_link('Snippets') + end end end end + + context 'with combined_menu: feature flag on' do + let(:needs_rewrite_for_combined_menu_flag_on) { true } + + before do + stub_feature_flags(combined_menu: true) + end + + it_behaves_like 'combined_menu: feature flag examples' + end + + context 'with combined_menu feature flag off' do + let(:needs_rewrite_for_combined_menu_flag_on) { false } + + before do + stub_feature_flags(combined_menu: false) + end + + 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 |