Skip to content

Commit

Permalink
[Security_Solution][Bug] Fix user name/domain to ECS structure (#73530)
Browse files Browse the repository at this point in the history
* The changes this tests are being ported separately to 7.9
bkimmel authored Jul 29, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent e645732 commit 0b708e0
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { eventType, orderByTime } from './process_event';
import { eventType, orderByTime, userInfoForProcess } from './process_event';

import { mockProcessEvent } from './process_event_test_helpers';
import { LegacyEndpointEvent, ResolverEvent } from '../../../common/endpoint/types';
@@ -24,6 +24,22 @@ describe('process event', () => {
expect(eventType(event)).toEqual('processCreated');
});
});
describe('userInfoForProcess', () => {
let event: LegacyEndpointEvent;
beforeEach(() => {
event = mockProcessEvent({
user: {
name: 'aaa',
domain: 'bbb',
},
});
});
it('returns the right user info for the process', () => {
const { name, domain } = userInfoForProcess(event)!;
expect(name).toEqual('aaa');
expect(domain).toEqual('bbb');
});
});
describe('orderByTime', () => {
let mock: (time: number, eventID: string) => ResolverEvent;
let events: ResolverEvent[];

0 comments on commit 0b708e0

Please sign in to comment.