Commit 9fd8789a authored by Alexander Turinske's avatar Alexander Turinske

Add scanner vendor to scanner column

- for normal scanners, the vendor will be `GitLab`
- for custom scnners, the vendor will a custom string
- if no scanner exists, the report type should still show
- add tests
parent 5433dadb
......@@ -70,6 +70,9 @@ export default {
useConvertReportType() {
return convertReportType(this.vulnerability.report_type);
},
vulnerabilityVendor() {
return this.vulnerability.scanner?.vendor || '';
},
},
methods: {
...mapActions('vulnerabilities', ['openModal', 'selectVulnerability', 'deselectVulnerability']),
......@@ -155,8 +158,13 @@ export default {
<div class="table-section section-15">
<div class="table-mobile-header" role="rowheader">{{ s__('Reports|Scanner') }}</div>
<div class="table-mobile-content text-capitalize">
{{ useConvertReportType }}
<div class="table-mobile-content">
<div class="text-capitalize">
{{ useConvertReportType }}
</div>
<div class="gl-text-gray-500">
{{ vulnerabilityVendor }}
</div>
</div>
</div>
......
---
title: Add scanner vendor to pipeline scanner column
merge_request: 36764
author:
type: changed
......@@ -53,6 +53,10 @@ describe('Security Dashboard Table Row', () => {
expect(findContent(0).text()).toEqual('');
});
it('should render a `` for the report type and scanner', () => {
expect(findContent(3).text()).toEqual('');
});
it('should not render action buttons', () => {
expect(wrapper.findAll('.action-buttons button')).toHaveLength(0);
});
......@@ -89,6 +93,10 @@ describe('Security Dashboard Table Row', () => {
).toContain(vulnerability.report_type.toLowerCase());
});
it('should render the scanner vendor if the scanner does exist', () => {
expect(findContent(3).text()).toContain(vulnerability.scanner.vendor);
});
describe('the project name', () => {
it('should render the name', () => {
expect(findContent(1).text()).toContain(vulnerability.name);
......
......@@ -8,6 +8,7 @@ export default [
scanner: {
external_id: 'find_sec_bugs',
name: 'Find Security Bugs',
vendor: 'GitLab',
},
identifiers: [
{
......@@ -75,6 +76,7 @@ export default [
scanner: {
external_id: 'find_sec_bugs',
name: 'Find Security Bugs',
vendor: 'GitLab',
},
identifiers: [
{
......@@ -128,6 +130,7 @@ export default [
scanner: {
external_id: 'find_sec_bugs',
name: 'Find Security Bugs',
vendor: 'GitLab',
},
identifiers: [
{
......@@ -205,6 +208,7 @@ export default [
scanner: {
external_id: 'find_sec_bugs',
name: 'Find Security Bugs',
vendor: 'GitLab',
},
identifiers: [
{
......@@ -283,6 +287,7 @@ export default [
scanner: {
external_id: 'find_sec_bugs',
name: 'Find Security Bugs',
vendor: 'GitLab',
},
identifiers: [
{
......@@ -384,6 +389,7 @@ export default [
scanner: {
external_id: 'find_sec_bugs',
name: 'Find Security Bugs',
vendor: 'GitLab',
},
identifiers: [
{
......@@ -437,6 +443,7 @@ export default [
scanner: {
external_id: 'find_sec_bugs',
name: 'Find Security Bugs',
vendor: 'GitLab',
},
identifiers: [
{
......@@ -514,6 +521,7 @@ export default [
scanner: {
external_id: 'clair',
name: 'Clair',
vendor: 'GitLab',
},
identifiers: [
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment