Commit 45595768 authored by Jannik Lehmann's avatar Jannik Lehmann Committed by Andrew Fontaine

Update sidebartogglebutton Template

The sidebartogglebutton Template produced invalid
HTML output, this commit fixes that.
parent bcb377af
......@@ -439,8 +439,6 @@
%span
= _('Pages')
= render 'shared/sidebar_toggle_button'
-# Shortcut to Project > Activity
%li.hidden
= link_to activity_project_path(@project), title: _('Activity'), class: 'shortcuts-project-activity' do
......@@ -475,3 +473,5 @@
- if project_nav_tab?(:issues)
%li.hidden
= link_to _('Issue Boards'), project_boards_path(@project), title: _('Issue Boards'), class: 'shortcuts-issue-boards'
= render 'shared/sidebar_toggle_button'
......@@ -8,12 +8,13 @@ RSpec.shared_examples 'verified navigation bar' do
end
it 'renders correctly' do
current_structure = page.all('.sidebar-top-level-items > li', class: ['!hidden']).map do |item|
# we are using * here in the selectors to prevent a regression where we added a non 'li' inside an 'ul'
current_structure = page.all('.sidebar-top-level-items > *', class: ['!hidden']).map do |item|
next if item.find_all('a').empty?
nav_item = item.find_all('a').first.text.gsub(/\s+\d+$/, '') # remove counts at the end
nav_sub_items = item.all('.sidebar-sub-level-items > li', class: ['!fly-out-top-item']).map do |list_item|
nav_sub_items = item.all('.sidebar-sub-level-items > *', class: ['!fly-out-top-item']).map do |list_item|
list_item.all('a').first.text
end
......
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