diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/test_subjects.ts b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/test_subjects.ts index b1eddf50f7c14..6393bd8799683 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/test_subjects.ts +++ b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/test_subjects.ts @@ -11,6 +11,7 @@ export const JSON_TAB_VULNERABILITY_FLYOUT = 'vulnerability_json_tab_flyout'; export const OVERVIEW_TAB_VULNERABILITY_FLYOUT = 'vulnerability_overview_tab_flyout'; export const DATA_SOURCE_VULNERABILITY_FLYOUT = 'vulnerability_flyout_data_source_display_box'; export const PUBLISHED_DATE_VULNERABILITY_FLYOUT = 'vulnerability_flyout_date_display_box'; +export const VULNERABILITY_SCORES_FLYOUT = 'vulnerability_flyout_score'; export const TAB_ID_VULNERABILITY_FLYOUT = (tabId: string) => `vulnerability-finding-flyout-tab-${tabId}`; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx index 081eff33c5c96..8f3f37390cfae 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx @@ -17,6 +17,7 @@ import { DATA_SOURCE_VULNERABILITY_FLYOUT, FINDINGS_VULNERABILITY_FLYOUT_DESCRIPTION_LIST, PUBLISHED_DATE_VULNERABILITY_FLYOUT, + VULNERABILITY_SCORES_FLYOUT, } from '../test_subjects'; import { EMPTY_VALUE } from '../../configurations/findings_flyout/findings_flyout'; @@ -93,8 +94,10 @@ describe('', () => { ); const dataSource = getByTestId(DATA_SOURCE_VULNERABILITY_FLYOUT); const publisedDate = getByTestId(PUBLISHED_DATE_VULNERABILITY_FLYOUT); + const vulnerabilityScores = getByTestId(VULNERABILITY_SCORES_FLYOUT); expect(dataSource.textContent).toEqual(`Data Source${EMPTY_VALUE}`); expect(publisedDate.textContent).toEqual(`Published Date${EMPTY_VALUE}`); + expect(vulnerabilityScores.textContent).toEqual(`Vulnerability Scores${EMPTY_VALUE}`); }); it('show empty state for no fixes', () => { diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_overview_tab.tsx b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_overview_tab.tsx index 9848bbd402e50..e25bbbf6c3111 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_overview_tab.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_overview_tab.tsx @@ -33,6 +33,7 @@ import { DATA_SOURCE_VULNERABILITY_FLYOUT, OVERVIEW_TAB_VULNERABILITY_FLYOUT, PUBLISHED_DATE_VULNERABILITY_FLYOUT, + VULNERABILITY_SCORES_FLYOUT, } from '../test_subjects'; import redhatLogo from '../../../assets/icons/redhat_logo.svg'; import { VulnerabilityDetectionRuleCounter } from './vulnerability_detection_rule_counter'; @@ -309,8 +310,8 @@ export const VulnerabilityOverviewTab = ({ vulnerabilityRecord }: VulnerabilityT - {cvssScores?.length > 0 && ( - + { +

- {cvssScores} + {!!cvssScores?.length ? cvssScores : EMPTY_VALUE} - )} + } ); };