File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
x-pack/plugins/security_solution/public/resolver/models Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 33 * or more contributor license agreements. Licensed under the Elastic License;
44 * you may not use this file except in compliance with the Elastic License.
55 */
6- import { eventType , orderByTime } from './process_event' ;
6+ import { eventType , orderByTime , userInfoForProcess } from './process_event' ;
77
88import { mockProcessEvent } from './process_event_test_helpers' ;
99import { LegacyEndpointEvent , ResolverEvent } from '../../../common/endpoint/types' ;
@@ -24,6 +24,22 @@ describe('process event', () => {
2424 expect ( eventType ( event ) ) . toEqual ( 'processCreated' ) ;
2525 } ) ;
2626 } ) ;
27+ describe ( 'userInfoForProcess' , ( ) => {
28+ let event : LegacyEndpointEvent ;
29+ beforeEach ( ( ) => {
30+ event = mockProcessEvent ( {
31+ user : {
32+ name : 'aaa' ,
33+ domain : 'bbb' ,
34+ } ,
35+ } ) ;
36+ } ) ;
37+ it ( 'returns the right user info for the process' , ( ) => {
38+ const { name, domain } = userInfoForProcess ( event ) ! ;
39+ expect ( name ) . toEqual ( 'aaa' ) ;
40+ expect ( domain ) . toEqual ( 'bbb' ) ;
41+ } ) ;
42+ } ) ;
2743 describe ( 'orderByTime' , ( ) => {
2844 let mock : ( time : number , eventID : string ) => ResolverEvent ;
2945 let events : ResolverEvent [ ] ;
You can’t perform that action at this time.
0 commit comments