debian-mirror-gitlab/spec/features/dashboard/active_tab_spec.rb

59 lines
1.5 KiB
Ruby
Raw Normal View History

2019-10-12 21:52:04 +05:30
# frozen_string_literal: true
2017-08-17 22:00:37 +05:30
require 'spec_helper'
2018-03-17 18:26:18 +05:30
RSpec.describe 'Dashboard Active Tab', :js do
2021-06-08 01:23:25 +05:30
shared_examples 'combined_menu: feature flag examples' do
before do
sign_in(create(:user))
end
2021-04-29 21:17:54 +05:30
2021-06-08 01:23:25 +05:30
shared_examples 'page has active tab' do |title|
it "#{title} tab" do
pending_on_combined_menu_flag
subject
2017-08-17 22:00:37 +05:30
2021-06-08 01:23:25 +05:30
expect(page).to have_selector('.navbar-sub-nav li.active', count: 1)
expect(find('.navbar-sub-nav li.active')).to have_content(title)
end
end
context 'on dashboard projects' do
it_behaves_like 'page has active tab', 'Projects' do
subject { visit dashboard_projects_path }
end
end
2018-11-18 11:00:15 +05:30
2021-06-08 01:23:25 +05:30
context 'on dashboard groups' do
it_behaves_like 'page has active tab', 'Groups' do
subject { visit dashboard_groups_path }
end
2017-08-17 22:00:37 +05:30
end
end
2021-06-08 01:23:25 +05:30
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)
2017-08-17 22:00:37 +05:30
end
2021-06-08 01:23:25 +05:30
it_behaves_like 'combined_menu: feature flag examples'
2017-08-17 22:00:37 +05:30
end
2021-06-08 01:23:25 +05:30
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)
2017-08-17 22:00:37 +05:30
end
2021-06-08 01:23:25 +05:30
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
2017-08-17 22:00:37 +05:30
end
end