Commit f157d3a4 authored by David Pisek's avatar David Pisek Committed by Ezekiel Kigbo

Vuln Details: Fix names of scanner and tool labels

parent bb2352cc
...@@ -200,12 +200,12 @@ export default { ...@@ -200,12 +200,12 @@ export default {
<detail-item :sprintf-message="__('%{labelStart}Severity:%{labelEnd} %{severity}')"> <detail-item :sprintf-message="__('%{labelStart}Severity:%{labelEnd} %{severity}')">
<severity-badge :severity="vulnerability.severity" class="gl-display-inline ml-1" /> <severity-badge :severity="vulnerability.severity" class="gl-display-inline ml-1" />
</detail-item> </detail-item>
<detail-item :sprintf-message="__('%{labelStart}Scan Type:%{labelEnd} %{reportType}')">{{ <detail-item :sprintf-message="__('%{labelStart}Tool:%{labelEnd} %{reportType}')">{{
humanReadableReportType humanReadableReportType
}}</detail-item> }}</detail-item>
<detail-item <detail-item
v-if="scanner.name" v-if="scanner.name"
:sprintf-message="__('%{labelStart}Tool:%{labelEnd} %{scanner}')" :sprintf-message="__('%{labelStart}Scanner:%{labelEnd} %{scanner}')"
> >
<component <component
:is="scannerDetails.component" :is="scannerDetails.component"
......
...@@ -35,7 +35,7 @@ describe('Vulnerability Details', () => { ...@@ -35,7 +35,7 @@ describe('Vulnerability Details', () => {
createWrapper(); createWrapper();
expect(getText('description')).toBe(vulnerability.description); expect(getText('description')).toBe(vulnerability.description);
expect(wrapper.find(SeverityBadge).props('severity')).toBe(vulnerability.severity); expect(wrapper.find(SeverityBadge).props('severity')).toBe(vulnerability.severity);
expect(getText('reportType')).toBe(`Scan Type: ${vulnerability.reportType}`); expect(getText('reportType')).toBe(`Tool: ${vulnerability.reportType}`);
expect(getById('title').exists()).toBe(false); expect(getById('title').exists()).toBe(false);
expect(getById('image').exists()).toBe(false); expect(getById('image').exists()).toBe(false);
...@@ -63,7 +63,7 @@ describe('Vulnerability Details', () => { ...@@ -63,7 +63,7 @@ describe('Vulnerability Details', () => {
'displays "$expectedOutput" when report type is "$reportType"', 'displays "$expectedOutput" when report type is "$reportType"',
({ reportType, expectedOutput }) => { ({ reportType, expectedOutput }) => {
createWrapper({ reportType }); createWrapper({ reportType });
expect(getText('reportType')).toBe(`Scan Type: ${expectedOutput}`); expect(getText('reportType')).toBe(`Tool: ${expectedOutput}`);
}, },
); );
...@@ -222,26 +222,26 @@ describe('Vulnerability Details', () => { ...@@ -222,26 +222,26 @@ describe('Vulnerability Details', () => {
const scannerText = () => getById('scanner').text(); const scannerText = () => getById('scanner').text();
it('shows the scanner name only but no link', () => { it('shows the scanner name only but no link', () => {
createWrapper({ scanner: { name: 'some tool' } }); createWrapper({ scanner: { name: 'some scanner' } });
expect(scannerText()).toBe('Tool: some tool'); expect(scannerText()).toBe('Scanner: some scanner');
expect(link().element instanceof HTMLSpanElement).toBe(true); expect(link().element instanceof HTMLSpanElement).toBe(true);
}); });
it('shows the scanner name and version but no link', () => { it('shows the scanner name and version but no link', () => {
createWrapper({ scanner: { name: 'some scanner', version: '1.2.3' } }); createWrapper({ scanner: { name: 'some scanner', version: '1.2.3' } });
expect(scannerText()).toBe('Tool: some scanner (version 1.2.3)'); expect(scannerText()).toBe('Scanner: some scanner (version 1.2.3)');
expect(link().element instanceof HTMLSpanElement).toBe(true); expect(link().element instanceof HTMLSpanElement).toBe(true);
}); });
it('shows the scanner name only with a link', () => { it('shows the scanner name only with a link', () => {
createWrapper({ scanner: { name: 'some tool', url: '//link' } }); createWrapper({ scanner: { name: 'some tool', url: '//link' } });
expect(scannerText()).toBe('Tool: some tool'); expect(scannerText()).toBe('Scanner: some tool');
expect(link().attributes('href')).toBe('//link'); expect(link().attributes('href')).toBe('//link');
}); });
it('shows the scanner name and version with a link', () => { it('shows the scanner name and version with a link', () => {
createWrapper({ scanner: { name: 'some tool', version: '1.2.3', url: '//link' } }); createWrapper({ scanner: { name: 'some tool', version: '1.2.3', url: '//link' } });
expect(scannerText()).toBe('Tool: some tool (version 1.2.3)'); expect(scannerText()).toBe('Scanner: some tool (version 1.2.3)');
expect(link().attributes('href')).toBe('//link'); expect(link().attributes('href')).toBe('//link');
}); });
}); });
......
...@@ -660,7 +660,7 @@ msgstr "" ...@@ -660,7 +660,7 @@ msgstr ""
msgid "%{labelStart}Namespace:%{labelEnd} %{namespace}" msgid "%{labelStart}Namespace:%{labelEnd} %{namespace}"
msgstr "" msgstr ""
msgid "%{labelStart}Scan Type:%{labelEnd} %{reportType}" msgid "%{labelStart}Scanner:%{labelEnd} %{scanner}"
msgstr "" msgstr ""
msgid "%{labelStart}Sent request:%{labelEnd} %{headers}" msgid "%{labelStart}Sent request:%{labelEnd} %{headers}"
...@@ -669,7 +669,7 @@ msgstr "" ...@@ -669,7 +669,7 @@ msgstr ""
msgid "%{labelStart}Severity:%{labelEnd} %{severity}" msgid "%{labelStart}Severity:%{labelEnd} %{severity}"
msgstr "" msgstr ""
msgid "%{labelStart}Tool:%{labelEnd} %{scanner}" msgid "%{labelStart}Tool:%{labelEnd} %{reportType}"
msgstr "" msgstr ""
msgid "%{labelStart}Unmodified response:%{labelEnd} %{headers}" msgid "%{labelStart}Unmodified response:%{labelEnd} %{headers}"
......
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