Commit c4e80089 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Merge branch '231026-fix-naming-on-vulnerability-details' into 'master'

Vuln Details: Fix names of scanner and tool labels

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