Commit 1d0b0975 authored by Alexander Turinske's avatar Alexander Turinske

Add check for empty identifiers array

- add additional test data for this case
parent 8eaed8ff
......@@ -211,6 +211,9 @@ export default {
return acc;
}, {});
},
shouldShowExtraIdentifierCount(identifiers) {
return identifiers?.length > 1;
},
shouldShowVulnerabilityPath(item) {
return Boolean(item.location.image || item.location.file);
},
......@@ -338,7 +341,7 @@ export default {
{{ primaryIdentifier(item.identifiers) }}
</div>
<div
v-if="extraIdentifierCount(item.identifiers)"
v-if="shouldShowExtraIdentifierCount(item.identifiers)"
data-testid="vulnerability-more-identifiers"
class="gl-text-gray-500"
>
......
......@@ -51,6 +51,7 @@ export const generateVulnerabilities = () => [
},
{
id: 'id_2',
identifiers: [],
title: 'Vulnerability 2',
severity: 'high',
state: 'opened',
......
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