diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/action_log_expanded_tray.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/action_log_expanded_tray.tsx index 7920bae8b22d79..b70a74d839bc98 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/action_log_expanded_tray.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/action_log_expanded_tray.tsx @@ -6,7 +6,7 @@ */ import React, { memo, useMemo } from 'react'; -import { EuiCodeBlock, EuiFlexGroup, EuiFlexItem, EuiDescriptionList } from '@elastic/eui'; +import { EuiCodeBlock, EuiDescriptionList, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { css, euiStyled } from '@kbn/kibana-react-plugin/common'; import { map } from 'lodash'; import { EndpointUploadActionResult } from '../../endpoint_upload_action_result'; @@ -96,7 +96,8 @@ const OutputContent = memo<{ action: MaybeImmutable; 'data-test-s canAccessEndpointActionsLogManagement, } = useUserPrivileges().endpointPrivileges; - const { command, isCompleted, isExpired, wasSuccessful, errors } = action; + const { command: _command, isCompleted, isExpired, wasSuccessful, errors } = action; + const command = getUiCommand(_command); if (errors?.length) { return ( diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/integration_tests/response_actions_log.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/integration_tests/response_actions_log.test.tsx index 1e835e34ac7ef3..93e6719db3569a 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/integration_tests/response_actions_log.test.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/integration_tests/response_actions_log.test.tsx @@ -34,6 +34,7 @@ import { getEndpointAuthzInitialStateMock } from '../../../../../common/endpoint import { useGetEndpointActionList as _useGetEndpointActionList } from '../../../hooks/response_actions/use_get_endpoint_action_list'; import { OUTPUT_MESSAGES } from '../translations'; import { EndpointActionGenerator } from '../../../../../common/endpoint/data_generators/endpoint_action_generator'; +import { getUiCommand } from '../components/hooks'; const useGetEndpointActionListMock = _useGetEndpointActionList as jest.Mock; @@ -981,10 +982,12 @@ describe('Response actions history', () => { render(); + const outputCommand = getUiCommand(command); + const outputs = expandRows(); expect(outputs.map((n) => n.textContent)).toEqual([ - expect.stringContaining(`${command} completed successfully`), - expect.stringContaining(`${command} completed successfully`), + expect.stringContaining(`${outputCommand} completed successfully`), + expect.stringContaining(`${outputCommand} completed successfully`), ]); expect( renderResult.getAllByTestId(`${testPrefix}-column-status`).map((n) => n.textContent) @@ -1006,10 +1009,11 @@ describe('Response actions history', () => { }); render(); + const outputCommand = getUiCommand(command); const outputs = expandRows(); expect(outputs.map((n) => n.textContent)).toEqual([ - `${command} failed`, - `${command} failed`, + `${outputCommand} failed`, + `${outputCommand} failed`, ]); expect( renderResult.getAllByTestId(`${testPrefix}-column-status`).map((n) => n.textContent) @@ -1032,10 +1036,11 @@ describe('Response actions history', () => { }); render(); + const outputCommand = getUiCommand(command); const outputs = expandRows(); expect(outputs.map((n) => n.textContent)).toEqual([ - `${command} failed: action expired`, - `${command} failed: action expired`, + `${outputCommand} failed: action expired`, + `${outputCommand} failed: action expired`, ]); expect( renderResult.getAllByTestId(`${testPrefix}-column-status`).map((n) => n.textContent)