Skip to content

Commit

Permalink
remove unused import
Browse files Browse the repository at this point in the history
  • Loading branch information
CAWilson94 committed Nov 6, 2024
1 parent a9f10e5 commit 4cb4044
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,4 @@ export const SIGNAL_STATUS_FIELD_NAME = 'kibana.alert.workflow_status';
export const AGENT_STATUS_FIELD_NAME = 'agent.status';
export const QUARANTINED_PATH_FIELD_NAME = 'quarantined.path';
export const REASON_FIELD_NAME = 'kibana.alert.reason';
export const RISK_SCORE = 'kibana.alert.risk_score';
export const EVENT_SUMMARY_FIELD_NAME = 'eventSummary';
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { useMountAppended } from '../../../../../common/utils/use_mount_appended

import { FormattedFieldValue } from './formatted_field';
import { HOST_NAME_FIELD_NAME } from './constants';
import { formatRiskScore } from '../../../../../entity_analytics/common';

jest.mock('@elastic/eui', () => {
const original = jest.requireActual('@elastic/eui');
Expand Down Expand Up @@ -286,39 +285,4 @@ describe('Events', () => {
);
expect(wrapper.text()).toEqual(getEmptyValue());
});

test('it renders the formatted risk score when fieldName is RISK_SCORE and value is provided', () => {
const riskScoreValue = 85;
const wrapper = mount(
<TestProviders>
<FormattedFieldValue
contextId="test"
eventId={mockTimelineData[0].ecs._id}
fieldName="kibana.alert.risk_score"
value={riskScoreValue}
/>
</TestProviders>
);

expect(
wrapper.find(`[data-test-subj="formatted-field-kibana.alert.risk_score"]`).text()
).toEqual(formatRiskScore(riskScoreValue));
});

test('it does not render anything when fieldName is RISK_SCORE and value is not provided', () => {
const wrapper = mount(
<TestProviders>
<FormattedFieldValue
contextId="test"
eventId={mockTimelineData[0].ecs._id}
fieldName="kibana.alert.risk_score"
value={null}
/>
</TestProviders>
);

expect(
wrapper.find(`[data-test-subj="formatted-field-kibana.alert.risk_score"]`).exists()
).toEqual(false);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { isEmpty, isNumber } from 'lodash/fp';
import React from 'react';
import { css } from '@emotion/css';
import type { FieldSpec } from '@kbn/data-plugin/common';
import { formatRiskScore } from '../../../../../entity_analytics/common';
import { getAgentTypeForAgentIdField } from '../../../../../common/lib/endpoint/utils/get_agent_type_for_agent_id_field';
import {
ALERT_HOST_CRITICALITY,
Expand All @@ -40,7 +39,6 @@ import {
IP_FIELD_TYPE,
MESSAGE_FIELD_NAME,
REFERENCE_URL_FIELD_NAME,
RISK_SCORE,
RULE_REFERENCE_FIELD_NAME,
SIGNAL_RULE_NAME_FIELD_NAME,
SIGNAL_STATUS_FIELD_NAME,
Expand Down Expand Up @@ -241,10 +239,6 @@ const FormattedFieldValueComponent: React.FC<{
value={value}
/>
);
} else if (fieldName === RISK_SCORE) {
return value ? (
<span data-test-subj={`formatted-field-${fieldName}`}>{formatRiskScore(Number(value))}</span>
) : null;
} else if (fieldName === EVENT_MODULE_FIELD_NAME) {
return renderEventModule({
contextId,
Expand Down

0 comments on commit 4cb4044

Please sign in to comment.