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
… (#73623)

* The changes this tests are being ported separately to 7.9
  • Loading branch information
bkimmel authored Jul 29, 2020
1 parent 9551eef commit 2c84e41
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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[];
Expand Down

0 comments on commit 2c84e41

Please sign in to comment.