diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-15 21:08:43 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-15 21:08:43 +0300 |
commit | 316fbf9f95dcdd16775f0339415572c3195eea92 (patch) | |
tree | 40d86a896fc0ff8ce22fbed7e5e3dffc2adceebf /spec/features/alert_management | |
parent | d9e71b0d412fb9d2d7fc8b00dddac21617eaaf19 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/alert_management')
-rw-r--r-- | spec/features/alert_management/user_searches_alerts_spec.rb | 18 | ||||
-rw-r--r-- | spec/features/alert_management/user_updates_alert_status_spec.rb | 36 |
2 files changed, 42 insertions, 12 deletions
diff --git a/spec/features/alert_management/user_searches_alerts_spec.rb b/spec/features/alert_management/user_searches_alerts_spec.rb index 0a6517101af..568321de025 100644 --- a/spec/features/alert_management/user_searches_alerts_spec.rb +++ b/spec/features/alert_management/user_searches_alerts_spec.rb @@ -20,18 +20,12 @@ RSpec.describe 'User searches Alert Management alerts', :js do end context 'when a developer displays the alert list and the alert service is enabled they can search an alert' do - it 'shows the alert table with an alert for a valid search' do - expect(page).to have_selector('[data-testid="search-icon"]') - - find('.gl-search-box-by-type-input').set('Alert') - - expect(all('.dropdown-menu-selectable').count).to be(1) - end - - it 'shows the an empty table with an invalid search' do - find('.gl-search-box-by-type-input').set('invalid search text') - - expect(page).not_to have_selector('.dropdown-menu-selectable') + it 'shows the incident table with an incident for a valid search filter bar' do + expect(page).to have_selector('.filtered-search-wrapper') + expect(page).to have_selector('.gl-table') + expect(page).to have_css('[data-testid="severityField"]') + expect(all('tbody tr').count).to be(1) + expect(page).not_to have_selector('.empty-state') end end end diff --git a/spec/features/alert_management/user_updates_alert_status_spec.rb b/spec/features/alert_management/user_updates_alert_status_spec.rb new file mode 100644 index 00000000000..8974796662c --- /dev/null +++ b/spec/features/alert_management/user_updates_alert_status_spec.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'User updates Alert Management status', :js do + let_it_be(:project) { create(:project) } + let_it_be(:developer) { create(:user) } + let_it_be(:alerts_service) { create(:alerts_service, project: project) } + let_it_be(:alert) { create(:alert_management_alert, project: project, status: 'triggered') } + + before_all do + project.add_developer(developer) + end + + before do + sign_in(developer) + + visit project_alert_management_index_path(project) + wait_for_requests + end + + context 'when a developer+ displays the alerts list and the alert service is enabled they can update an alert status' do + it 'shows the alert table with an alert status dropdown' do + expect(page).to have_selector('.gl-table') + expect(find('.dropdown-menu-selectable')).to have_content('Triggered') + end + + it 'updates the alert status' do + find('.dropdown-menu-selectable').click + find('.dropdown-item', text: 'Acknowledged').click + wait_for_requests + + expect(find('.dropdown-menu-selectable')).to have_content('Acknowledged') + end + end +end |