Commit 6a0a5482 authored by Gilang Gumilar's avatar Gilang Gumilar

Add navbar spec

parent 999f8da0
- navbar_links = links.sort_by(&:title)
- all_paths = navbar_links.map(&:path)
- analytics_link = navbar_links.select { |link| link.title == _('Value Stream') }.first || navbar_links.first
- analytics_link = navbar_links.find { |link| link.title == _('Value Stream') } || navbar_links.first
- if navbar_links.any?
= nav_link(path: all_paths) do
= link_to analytics_link.link do
= link_to analytics_link.link, { data: { qa_selector: 'analytics_anchor' } } do
.nav-icon-container
= sprite_icon('chart')
%span.nav-item-name{ data: { qa_selector: 'analytics_link' } }
......
......@@ -4,6 +4,7 @@ require 'spec_helper'
describe 'Group navbar' do
include NavbarStructureHelper
include WaitForRequests
include_context 'group navbar structure'
......@@ -45,6 +46,16 @@ describe 'Group navbar' do
end
it_behaves_like 'verified navigation bar'
it 'redirects to value stream when Analytics item is clicked' do
page.within('.sidebar-top-level-items') do
find('[data-qa-selector=analytics_anchor]').click
end
wait_for_requests
expect(page).to have_current_path(group_analytics_cycle_analytics_path(group))
end
end
context 'when epics are available' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment