diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
commit | 859a6fb938bb9ee2a317c46dfa4fcc1af49608f0 (patch) | |
tree | d7f2700abe6b4ffcb2dcfc80631b2d87d0609239 /spec/support/shared_examples/features/navbar_shared_examples.rb | |
parent | 446d496a6d000c73a304be52587cd9bbc7493136 (diff) |
Add latest changes from gitlab-org/gitlab@13-9-stable-eev13.9.0-rc42
Diffstat (limited to 'spec/support/shared_examples/features/navbar_shared_examples.rb')
-rw-r--r-- | spec/support/shared_examples/features/navbar_shared_examples.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/support/shared_examples/features/navbar_shared_examples.rb b/spec/support/shared_examples/features/navbar_shared_examples.rb index c768e95c45a..9b89a3b5e54 100644 --- a/spec/support/shared_examples/features/navbar_shared_examples.rb +++ b/spec/support/shared_examples/features/navbar_shared_examples.rb @@ -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 |