summaryrefslogtreecommitdiff
path: root/spec/features/contextual_sidebar_spec.rb
blob: e250e8cc90a5e9d6f568a794750783b87a13700e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# frozen_string_literal: true

require 'spec_helper'

describe 'Contextual sidebar', :js do
  let(:user) { create(:user) }
  let(:project) { create(:project) }

  before do
    project.add_maintainer(user)
    sign_in(user)

    visit project_path(project)
  end

  it 'shows flyout navs when collapsed or expanded apart from on the active item when expanded' do
    expect(page).not_to have_selector('.js-sidebar-collapsed')

    find('.rspec-link-pipelines').hover

    expect(page).to have_selector('.is-showing-fly-out')

    find('.rspec-project-link').hover

    expect(page).not_to have_selector('.is-showing-fly-out')

    find('.rspec-toggle-sidebar').click

    find('.rspec-link-pipelines').hover

    expect(page).to have_selector('.is-showing-fly-out')

    find('.rspec-project-link').hover

    expect(page).to have_selector('.is-showing-fly-out')
  end
end