Welcome to mirror list, hosted at ThFree Co, Russian Federation.

navigation_matcher.rb « matchers « support « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a0beecbfb2c5ba41019f8b90b2b9addc7d21ed4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# frozen_string_literal: true

RSpec::Matchers.define :have_active_navigation do |expected|
  match do |page|
    expect(page).to have_selector('.sidebar-top-level-items > li.active', count: 1)
    expect(page.find('.sidebar-top-level-items > li.active')).to have_content(expected)
  end
end

RSpec::Matchers.define :have_active_sub_navigation do |expected|
  match do |page|
    expect(page).to have_css('.sidebar-sub-level-items > li.active:not(.fly-out-top-item)', text: expected)
  end
end