Skip to content

Commit 2c84e41

Browse files
authored
[Security_Solution][Bug] Fix user name/domain to ECS structure (#73530) (#73623)
* The changes this tests are being ported separately to 7.9
1 parent 9551eef commit 2c84e41

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

x-pack/plugins/security_solution/public/resolver/models/process_event.test.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
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

88
import { mockProcessEvent } from './process_event_test_helpers';
99
import { 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[];

0 commit comments

Comments
 (0)