diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /spec/finders/alert_management | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'spec/finders/alert_management')
-rw-r--r-- | spec/finders/alert_management/alerts_finder_spec.rb | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/spec/finders/alert_management/alerts_finder_spec.rb b/spec/finders/alert_management/alerts_finder_spec.rb index e74f3ac68ed..87a5da38dd1 100644 --- a/spec/finders/alert_management/alerts_finder_spec.rb +++ b/spec/finders/alert_management/alerts_finder_spec.rb @@ -8,6 +8,8 @@ RSpec.describe AlertManagement::AlertsFinder, '#execute' do let_it_be(:resolved_alert) { create(:alert_management_alert, :all_fields, :resolved, project: project, ended_at: 1.year.ago, events: 2, severity: :high) } let_it_be(:ignored_alert) { create(:alert_management_alert, :all_fields, :ignored, project: project, events: 1, severity: :critical) } let_it_be(:triggered_alert) { create(:alert_management_alert, :all_fields) } + let_it_be(:threat_monitroing_alert) { create(:alert_management_alert, domain: 'threat_monitoring') } + let(:params) { {} } describe '#execute' do @@ -22,6 +24,26 @@ RSpec.describe AlertManagement::AlertsFinder, '#execute' do project.add_developer(current_user) end + context 'domain' do + context 'domain is threat management' do + let(:params) { { domain: 'threat_management' } } + + it { is_expected.to contain_exactly(resolved_alert, ignored_alert) } + end + + context 'domain is unknown' do + let(:params) { { domain: 'unkown' } } + + it { is_expected.to contain_exactly(resolved_alert, ignored_alert) } + end + + context 'domain is missing' do + let(:params) { {} } + + it { is_expected.to contain_exactly(resolved_alert, ignored_alert) } + end + end + context 'empty params' do it { is_expected.to contain_exactly(resolved_alert, ignored_alert) } end @@ -233,12 +255,6 @@ RSpec.describe AlertManagement::AlertsFinder, '#execute' do it { is_expected.to be_empty } end - - context 'empty search' do - let(:params) { { search: ' ' } } - - it { is_expected.not_to include(alert) } - end end context 'assignee username given' do @@ -257,12 +273,6 @@ RSpec.describe AlertManagement::AlertsFinder, '#execute' do it { is_expected.to be_empty } end - - context 'with empty assignee_username' do - let(:username) { ' ' } - - it { is_expected.not_to include(alert) } - end end end end |