Skip to content

Commit

Permalink
[7.8] Fix value for process.hash.sha256 draggable (#72142) (#72232)
Browse files Browse the repository at this point in the history
* Fix value for process.hash.sha256 draggable (#72142)

# Conflicts:
#	x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_file_details.test.tsx
#	x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_file_details.tsx

* Update generic_file_details.test.tsx

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
patrykkopycinski and elasticmachine authored Jul 17, 2020
1 parent 639efac commit ac93f61
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import React from 'react';
import { BrowserFields } from '../../../../../containers/source';
import { mockBrowserFields } from '../../../../../containers/source/mock';
import { mockTimelineData, TestProviders } from '../../../../../mock';
import { mockEndgameCreationEvent } from '../../../../../mock/mock_endgame_ecs_data';
import { SystemGenericFileDetails, SystemGenericFileLine } from './generic_file_details';
import { useMountAppended } from '../../../../../utils/use_mount_appended';

Expand Down Expand Up @@ -48,6 +49,23 @@ describe('SystemGenericFileDetails', () => {
'Evan@zeek-london[generic-text-123](6278)with resultfailureSource128.199.212.120'
);
});

test('it passes string value for processHashSha256', () => {
const wrapper = mount(
<TestProviders>
<SystemGenericFileDetails
contextId="[contextid-123]"
text="[generic-text-123]"
browserFields={mockBrowserFields}
data={mockEndgameCreationEvent}
timelineId="test"
/>
</TestProviders>
);
expect(wrapper.find('SystemGenericFileLine').prop('processHashSha256')).toEqual(
'd4c97ed46046893141652e2ec0056a698f6445109949d7fcabbce331146889ee'
);
});
});

describe('#SystemGenericFileLine', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export const SystemGenericFileDetails = React.memo<GenericDetailsProps>(
const packageVersion: string | null | undefined = get('system.audit.package.version[0]', data);
const processHashMd5: string | null | undefined = get('process.hash.md5[0]', data);
const processHashSha1: string | null | undefined = get('process.hash.sha1[0]', data);
const processHashSha256: string | null | undefined = get('process.hash.sha256', data);
const processHashSha256: string | null | undefined = get('process.hash.sha256[0]', data);
const processPid: number | null | undefined = get('process.pid[0]', data);
const processPpid: number | null | undefined = get('process.ppid[0]', data);
const processName: string | null | undefined = get('process.name[0]', data);
Expand Down

0 comments on commit ac93f61

Please sign in to comment.