diff options
Diffstat (limited to 'spec/helpers/nav')
-rw-r--r-- | spec/helpers/nav/top_nav_helper_spec.rb | 126 |
1 files changed, 4 insertions, 122 deletions
diff --git a/spec/helpers/nav/top_nav_helper_spec.rb b/spec/helpers/nav/top_nav_helper_spec.rb index 9c396d6bf25..0d43cfaae90 100644 --- a/spec/helpers/nav/top_nav_helper_spec.rb +++ b/spec/helpers/nav/top_nav_helper_spec.rb @@ -27,11 +27,9 @@ RSpec.describe Nav::TopNavHelper do let(:subject) { helper.top_nav_view_model(project: current_project, group: current_group) } - let(:menu_title) { 'Menu' } + let(:menu_tooltip) { 'Main menu' } before do - stub_feature_flags(new_navbar_layout: false) - allow(Gitlab::CurrentSettings).to receive(:admin_mode) { with_current_settings_admin_mode } allow(helper).to receive(:header_link?).with(:admin_mode) { with_header_link_admin_mode } @@ -46,8 +44,8 @@ RSpec.describe Nav::TopNavHelper do allow(helper).to receive(:dashboard_nav_link?).with(:activity) { with_activity } end - it 'has :menuTitle' do - expect(subject[:menuTitle]).to eq(menu_title) + it 'has :menuTooltip' do + expect(subject[:menuTooltip]).to eq(menu_tooltip) end context 'when current_user is nil (anonymous)' do @@ -108,7 +106,7 @@ RSpec.describe Nav::TopNavHelper do let(:current_user) { user } it 'has no menu items or views by default' do - expect(subject).to eq({ menuTitle: menu_title, + expect(subject).to eq({ menuTooltip: menu_tooltip, primary: [], secondary: [], shortcuts: [], @@ -176,74 +174,6 @@ RSpec.describe Nav::TopNavHelper do expect(projects_view[:linksSecondary]).to eq([]) end - context 'when extra submenu options are not hidden' do - before do - stub_feature_flags(remove_extra_primary_submenu_options: false) - end - - it 'has expected :linksPrimary' do - expected_links_primary = [ - ::Gitlab::Nav::TopNavMenuItem.build( - data: { - qa_selector: 'menu_item_link', - qa_title: 'Your projects', - **menu_data_tracking_attrs('your_projects') - }, - href: '/dashboard/projects', - id: 'your', - title: 'Your projects' - ), - ::Gitlab::Nav::TopNavMenuItem.build( - data: { - qa_selector: 'menu_item_link', - qa_title: 'Starred projects', - **menu_data_tracking_attrs('starred_projects') - }, - href: '/dashboard/projects/starred', - id: 'starred', - title: 'Starred projects' - ), - ::Gitlab::Nav::TopNavMenuItem.build( - data: { - qa_selector: 'menu_item_link', - qa_title: 'Explore projects', - **menu_data_tracking_attrs('explore_projects') - }, - href: '/explore', - id: 'explore', - title: 'Explore projects' - ), - ::Gitlab::Nav::TopNavMenuItem.build( - data: { - qa_selector: 'menu_item_link', - qa_title: 'Explore topics', - **menu_data_tracking_attrs('explore_topics') - }, - href: '/explore/projects/topics', - id: 'topics', - title: 'Explore topics' - ) - ] - expect(projects_view[:linksPrimary]).to eq(expected_links_primary) - end - - it 'has expected :linksSecondary' do - expected_links_secondary = [ - ::Gitlab::Nav::TopNavMenuItem.build( - data: { - qa_selector: 'menu_item_link', - qa_title: 'Create new project', - **menu_data_tracking_attrs('create_new_project') - }, - href: '/projects/new', - id: 'create', - title: 'Create new project' - ) - ] - expect(projects_view[:linksSecondary]).to eq(expected_links_secondary) - end - end - context 'with current nav as project' do before do helper.nav('project') @@ -341,54 +271,6 @@ RSpec.describe Nav::TopNavHelper do expect(groups_view[:linksSecondary]).to eq([]) end - context 'when extra submenu options are not hidden' do - before do - stub_feature_flags(remove_extra_primary_submenu_options: false) - end - - it 'has expected :linksPrimary' do - expected_links_primary = [ - ::Gitlab::Nav::TopNavMenuItem.build( - data: { - qa_selector: 'menu_item_link', - qa_title: 'Your groups', - **menu_data_tracking_attrs('your_groups') - }, - href: '/dashboard/groups', - id: 'your', - title: 'Your groups' - ), - ::Gitlab::Nav::TopNavMenuItem.build( - data: { - qa_selector: 'menu_item_link', - qa_title: 'Explore groups', - **menu_data_tracking_attrs('explore_groups') - }, - href: '/explore/groups', - id: 'explore', - title: 'Explore groups' - ) - ] - expect(groups_view[:linksPrimary]).to eq(expected_links_primary) - end - - it 'has expected :linksSecondary' do - expected_links_secondary = [ - ::Gitlab::Nav::TopNavMenuItem.build( - data: { - qa_selector: 'menu_item_link', - qa_title: 'Create group', - **menu_data_tracking_attrs('create_group') - }, - href: '/groups/new', - id: 'create', - title: 'Create group' - ) - ] - expect(groups_view[:linksSecondary]).to eq(expected_links_secondary) - end - end - context 'with external user' do let(:current_user) { external_user } |