Skip to content
Snippets Groups Projects

Resolve "Limit Group Security Dashboard to selected types of vulnerabilities"

Merged Tetiana Chupryna requested to merge 9393-limit-report-types-for-group-sec into master
All threads resolved!
1 file
+ 5
5
Compare changes
  • Side-by-side
  • Inline
@@ -219,7 +219,7 @@ def create_vulnerabilities(count, project, options = {})
@@ -219,7 +219,7 @@ def create_vulnerabilities(count, project, options = {})
group.add_developer(user)
group.add_developer(user)
end
end
it 'returns vulnerabilities counts' do
it 'returns vulnerabilities counts for :sast and :dependency_scanning' do
subject
subject
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(200)
@@ -351,16 +351,16 @@ def create_vulnerabilities(count, project, options = {})
@@ -351,16 +351,16 @@ def create_vulnerabilities(count, project, options = {})
it 'returns filtered history if filters are enabled' do
it 'returns filtered history if filters are enabled' do
travel_to(Time.zone.parse('2019-02-10')) do
travel_to(Time.zone.parse('2019-02-10')) do
get :history, params: { group_id: group, report_type: %w[dependency_scanning sast] }, format: :json
get :history, params: { group_id: group, report_type: %w[dependency_scanning sast dast] }, format: :json
end
end
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(200)
expect(json_response).to be_an(Hash)
expect(json_response).to be_an(Hash)
expect(json_response['total']).to eq({ '2018-11-10' => 5, '2018-11-12' => 2 })
expect(json_response['total']).to eq({ '2018-11-10' => 5, '2018-11-12' => 4 })
expect(json_response['critical']).to eq({ '2018-11-10' => 1 })
expect(json_response['critical']).to eq({ '2018-11-10' => 1 })
expect(json_response['high']).to eq({ '2018-11-10' => 2 })
expect(json_response['high']).to eq({ '2018-11-10' => 2 })
expect(json_response['medium']).to eq({})
expect(json_response['medium']).to eq({ '2018-11-12' => 1 })
expect(json_response['low']).to eq({ '2018-11-10' => 2, '2018-11-12' => 2 })
expect(json_response['low']).to eq({ '2018-11-10' => 2, '2018-11-12' => 3 })
expect(response).to match_response_schema('vulnerabilities/history', dir: 'ee')
expect(response).to match_response_schema('vulnerabilities/history', dir: 'ee')
end
end
end
end
Loading