blob: 2fbce27033e7e324e7a3e83e6533151d6d0c2b2c (
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
49
50
51
52
53
54
55
56
57
58
|
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Alert Management index', :js do
let_it_be(:project) { create(:project) }
let_it_be(:developer) { create(:user) }
before_all do
project.add_developer(developer)
end
context 'when a developer displays the alert list' do
before do
sign_in(developer)
visit project_alert_management_index_path(project)
wait_for_requests
end
it 'shows the alert page title and empty state without filtered search or alert table' do
expect(page).to have_content('Alerts')
expect(page).to have_content('Surface alerts in GitLab')
expect(page).not_to have_selector('.gl-table')
page.within('.layout-page') do
expect(page).not_to have_css('[data-testid="search-icon"]')
end
end
shared_examples 'alert page with title, filtered search, and table' do
it 'renders correctly' do
expect(page).to have_content('Alerts')
expect(page).to have_selector('.gl-table')
page.within('.layout-page') do
expect(page).to have_css('[data-testid="search-icon"]')
end
end
end
context 'when alerts have already been created' do
let_it_be(:alert) { create(:alert_management_alert, project: project) }
it_behaves_like 'alert page with title, filtered search, and table'
end
context 'when an HTTP integration is enabled' do
let_it_be(:integration) { create(:alert_management_http_integration, project: project) }
it_behaves_like 'alert page with title, filtered search, and table'
end
context 'when the prometheus integration is enabled' do
let_it_be(:integration) { create(:prometheus_integration, project: project) }
it_behaves_like 'alert page with title, filtered search, and table'
end
end
end
|