Commit bc58e2a0 authored by Andrew Fontaine's avatar Andrew Fontaine

Merge branch 'jnnkl-validhtml-sidebar' into 'master'

Update sidebartogglebutton Template

See merge request gitlab-org/gitlab!52680
parents bc6e5559 45595768
...@@ -439,8 +439,6 @@ ...@@ -439,8 +439,6 @@
%span %span
= _('Pages') = _('Pages')
= render 'shared/sidebar_toggle_button'
-# Shortcut to Project > Activity -# Shortcut to Project > Activity
%li.hidden %li.hidden
= link_to activity_project_path(@project), title: _('Activity'), class: 'shortcuts-project-activity' do = link_to activity_project_path(@project), title: _('Activity'), class: 'shortcuts-project-activity' do
...@@ -475,3 +473,5 @@ ...@@ -475,3 +473,5 @@
- if project_nav_tab?(:issues) - if project_nav_tab?(:issues)
%li.hidden %li.hidden
= link_to _('Issue Boards'), project_boards_path(@project), title: _('Issue Boards'), class: 'shortcuts-issue-boards' = 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 ...@@ -8,12 +8,13 @@ RSpec.shared_examples 'verified navigation bar' do
end end
it 'renders correctly' do 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? next if item.find_all('a').empty?
nav_item = item.find_all('a').first.text.gsub(/\s+\d+$/, '') # remove counts at the end 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 list_item.all('a').first.text
end 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