summaryrefslogtreecommitdiff
path: root/spec/features/incidents/incidents_list_spec.rb
blob: 61983f9290ca8f88363bd549612b5ef8d74b1766 (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
38
39
40
41
42
43
44
45
46
47
48
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe 'Incident Management index', :js, feature_category: :incident_management do
  let_it_be(:project) { create(:project) }
  let_it_be(:developer) { create(:user) }
  let_it_be(:incident) { create(:incident, project: project) }

  before_all do
    project.add_developer(developer)
  end

  before do
    sign_in(developer)

    visit project_incidents_path(project)
    wait_for_requests
  end

  context 'when a developer displays the incident list' do
    it 'shows the status tabs' do
      expect(page).to have_selector('.gl-tabs')
    end

    it 'shows the filtered search' do
      expect(page).to have_selector('.filtered-search-wrapper')
    end

    it 'shows the alert table' do
      expect(page).to have_selector('.gl-table')
    end

    it 'alert page title' do
      expect(page).to have_content('Incidents')
    end

    it 'has expected columns' do
      table = page.find('.gl-table')

      expect(table).to have_content('Severity')
      expect(table).to have_content('Incident')
      expect(table).to have_content('Status')
      expect(table).to have_content('Date created')
      expect(table).to have_content('Assignees')
    end
  end
end