Commit 0364c8e8 authored by Enrique Alcántara's avatar Enrique Alcántara

Merge branch '267513-fix-vendor-name-check' into 'master'

Take into account empty strings in vulnerability reports vendor names

See merge request gitlab-org/gitlab!45442
parents c172eb16 90041b5b
......@@ -102,7 +102,9 @@ export default {
return Boolean(this.$listeners['sort-changed']);
},
hasAnyScannersOtherThanGitLab() {
return this.filteredVulnerabilities.some(v => v.scanner?.vendor !== 'GitLab');
return this.filteredVulnerabilities.some(
v => v.scanner?.vendor !== 'GitLab' && v.scanner?.vendor !== '',
);
},
notEnabledSecurityScanners() {
const { available = [], enabled = [] } = this.securityScanners;
......
---
title: Fix GitLab vendor name appearing accidentally in the security reports when
it's the only one
merge_request: 45442
author:
type: fixed
......@@ -347,6 +347,25 @@ describe('Vulnerability list component', () => {
});
});
describe('when vendor name is not provided in the reports', () => {
let newVulnerabilities;
beforeEach(() => {
newVulnerabilities = generateVulnerabilities();
newVulnerabilities = newVulnerabilities.map(v => ({ ...v, scanner: { vendor: '' } }));
wrapper = createWrapper({
props: {
vulnerabilities: newVulnerabilities,
shouldShowReportType: true,
},
});
});
it('should not render the vendor name', () => {
expect(findVendorNames().exists()).toBe(false);
});
});
describe('when there are other scanners in the report', () => {
let newVulnerabilities;
......
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