Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Brent Kimmel committed Aug 5, 2020
1 parent b4d527a commit a48a10a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ interface Metadata {
* A simple mock dataAccessLayer possible that returns a tree with 0 ancestors and 2 direct children. 1 related event is returned. The parameter to `entities` is ignored.
*/
export function oneAncestorTwoChildren(
{
withRelatedEvents,
}: { withRelatedEvents: Parameters<typeof withRelatedEventsOnOrigin>[1] | null } = {
{ withRelatedEvents }: { withRelatedEvents: Iterable<[string, string]> | null } = {
withRelatedEvents: null,
}
): { dataAccessLayer: DataAccessLayer; metadata: Metadata } {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import uuid from 'uuid';
import { EndpointEvent } from '../../../../common/endpoint/types';

/**
Expand All @@ -15,19 +13,21 @@ export function mockRelatedEvent({
timestamp,
category,
type,
id,
}: {
entityID: string;
timestamp: number;
category: string;
type: string;
id?: string;
}): EndpointEvent {
return {
'@timestamp': timestamp,
event: {
kind: 'event',
type,
category,
id: uuid.v4(),
id: id ?? 'xyz',
},
process: {
entity_id: entityID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,9 @@ export class Simulator {
);
}

/**
* For a render of the Enzyme wrapper (may help update if other concerns have effected the render). May be useful for debugging.
*/
public updateWrapper() {
return this.wrapper.update();
}

/**
* Dump all contents of the outer ReactWrapper (to be `console.log`ged as appropriate)
* This will include both DOM (div, span, etc.) and React/JSX (MyComponent, MyGrid, etc.)
*/
public debugWrapper() {
return this.wrapper.debug();
Expand All @@ -242,6 +236,7 @@ export class Simulator {
public processNodeRelatedEventButton(entityID: string): ReactWrapper {
return this.processNodeElements({ entityID }).findWhere(
(wrapper) =>
// Filter out React components
typeof wrapper.type() === 'string' &&
wrapper.prop('data-test-subj') === 'resolver:submenu:button'
);
Expand Down

0 comments on commit a48a10a

Please sign in to comment.