Commit 90041b5b authored by Savas Vedova's avatar Savas Vedova

Take into account empty strings

- Add changelog
parent 043c95a0
......@@ -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