Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security_Solution][Resolver] Resolver loading and error state #75600

Merged
merged 12 commits into from
Aug 27, 2020
Prev Previous commit
make emptify arg required
  • Loading branch information
michaelolo24 committed Aug 27, 2020
commit 389f9127119b73678dc362288ed829061b2f874e
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ export function emptifyMock<T>(
dataAccessLayer: DataAccessLayer;
metadata: Metadata<T>;
},
dataShouldBeEmpty?: EmptiableRequests[]
dataShouldBeEmpty: EmptiableRequests[]
): {
dataAccessLayer: DataAccessLayer;
metadata: Metadata<T>;
@@ -48,7 +48,7 @@ export function emptifyMock<T>(
* Fetch related events for an entity ID
*/
async relatedEvents(...args): Promise<ResolverRelatedEvents> {
return dataShouldBeEmpty?.includes('relatedEvents')
return dataShouldBeEmpty.includes('relatedEvents')
? Promise.resolve({
entityID: args[0],
events: [],
@@ -61,7 +61,7 @@ export function emptifyMock<T>(
* Fetch a ResolverTree for a entityID
*/
async resolverTree(...args): Promise<ResolverTree> {
return dataShouldBeEmpty?.includes('resolverTree')
return dataShouldBeEmpty.includes('resolverTree')
? Promise.resolve(mockTreeWithNoProcessEvents())
: dataAccessLayer.resolverTree(...args);
},
@@ -70,7 +70,7 @@ export function emptifyMock<T>(
* Get an array of index patterns that contain events.
*/
indexPatterns(...args): string[] {
return dataShouldBeEmpty?.includes('indexPatterns')
return dataShouldBeEmpty.includes('indexPatterns')
? []
: dataAccessLayer.indexPatterns(...args);
},
@@ -79,7 +79,7 @@ export function emptifyMock<T>(
* Get entities matching a document.
*/
async entities(...args): Promise<ResolverEntityIndex> {
return dataShouldBeEmpty?.includes('entities')
return dataShouldBeEmpty.includes('entities')
? Promise.resolve([])
: dataAccessLayer.entities(...args);
},