diff options
Diffstat (limited to 'spec/helpers/nav/top_nav_helper_spec.rb')
-rw-r--r-- | spec/helpers/nav/top_nav_helper_spec.rb | 52 |
1 files changed, 7 insertions, 45 deletions
diff --git a/spec/helpers/nav/top_nav_helper_spec.rb b/spec/helpers/nav/top_nav_helper_spec.rb index ce5ac2e5404..2b69557b840 100644 --- a/spec/helpers/nav/top_nav_helper_spec.rb +++ b/spec/helpers/nav/top_nav_helper_spec.rb @@ -56,6 +56,7 @@ RSpec.describe Nav::TopNavHelper do expected_primary = [ { href: '/explore', icon: 'project', id: 'project', title: 'Projects' }, { href: '/explore/groups', icon: 'group', id: 'groups', title: 'Groups' }, + { href: '/explore/projects/topics', icon: 'labels', id: 'topics', title: 'Topics' }, { href: '/explore/snippets', icon: 'snippet', id: 'snippets', title: 'Snippets' } ].map do |item| ::Gitlab::Nav::TopNavMenuItem.build(**item) @@ -79,6 +80,12 @@ RSpec.describe Nav::TopNavHelper do css_class: 'dashboard-shortcuts-groups' }, { + href: '/explore/projects/topics', + id: 'topics-shortcut', + title: 'Topics', + css_class: 'dashboard-shortcuts-topics' + }, + { href: '/explore/snippets', id: 'snippets-shortcut', title: 'Snippets', @@ -320,20 +327,6 @@ RSpec.describe Nav::TopNavHelper do context 'with milestones' do let(:with_milestones) { true } - it 'has expected :primary' do - expected_header = ::Gitlab::Nav::TopNavMenuHeader.build( - title: 'Explore' - ) - expected_primary = ::Gitlab::Nav::TopNavMenuItem.build( - data: { **menu_data_tracking_attrs('milestones') }, - href: '/dashboard/milestones', - icon: 'clock', - id: 'milestones', - title: 'Milestones' - ) - expect(subject[:primary]).to eq([expected_header, expected_primary]) - end - it 'has expected :shortcuts' do expected_shortcuts = ::Gitlab::Nav::TopNavMenuItem.build( id: 'milestones-shortcut', @@ -348,23 +341,6 @@ RSpec.describe Nav::TopNavHelper do context 'with snippets' do let(:with_snippets) { true } - it 'has expected :primary' do - expected_header = ::Gitlab::Nav::TopNavMenuHeader.build( - title: 'Explore' - ) - expected_primary = ::Gitlab::Nav::TopNavMenuItem.build( - data: { - qa_selector: 'snippets_link', - **menu_data_tracking_attrs('snippets') - }, - href: '/dashboard/snippets', - icon: 'snippet', - id: 'snippets', - title: 'Snippets' - ) - expect(subject[:primary]).to eq([expected_header, expected_primary]) - end - it 'has expected :shortcuts' do expected_shortcuts = ::Gitlab::Nav::TopNavMenuItem.build( id: 'snippets-shortcut', @@ -379,20 +355,6 @@ RSpec.describe Nav::TopNavHelper do context 'with activity' do let(:with_activity) { true } - it 'has expected :primary' do - expected_header = ::Gitlab::Nav::TopNavMenuHeader.build( - title: 'Explore' - ) - expected_primary = ::Gitlab::Nav::TopNavMenuItem.build( - data: { **menu_data_tracking_attrs('activity') }, - href: '/dashboard/activity', - icon: 'history', - id: 'activity', - title: 'Activity' - ) - expect(subject[:primary]).to eq([expected_header, expected_primary]) - end - it 'has expected :shortcuts' do expected_shortcuts = ::Gitlab::Nav::TopNavMenuItem.build( id: 'activity-shortcut', |