File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
x-pack/test/api_integration/apis/endpoint Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,10 @@ import {
1717 ResolverNodeStats ,
1818 ResolverRelatedAlerts ,
1919} from '../../../../plugins/security_solution/common/endpoint/types' ;
20- import { parentEntityId } from '../../../../plugins/security_solution/common/endpoint/models/event' ;
20+ import {
21+ parentEntityId ,
22+ eventId ,
23+ } from '../../../../plugins/security_solution/common/endpoint/models/event' ;
2124import { FtrProviderContext } from '../../ftr_provider_context' ;
2225import {
2326 Event ,
@@ -167,10 +170,14 @@ const compareArrays = (
167170 if ( lengthCheck ) {
168171 expect ( expected . length ) . to . eql ( toTest . length ) ;
169172 }
173+
170174 toTest . forEach ( ( toTestEvent ) => {
171175 expect (
172176 expected . find ( ( arrEvent ) => {
173- return JSON . stringify ( arrEvent ) === JSON . stringify ( toTestEvent ) ;
177+ // we're only checking that the event ids are the same here. The reason we can't check the entire document
178+ // is because ingest pipelines are used to add fields to the document when it is received by elasticsearch,
179+ // therefore it will not be the same as the document created by the generator
180+ return eventId ( toTestEvent ) === eventId ( arrEvent ) ;
174181 } )
175182 ) . to . be . ok ( ) ;
176183 } ) ;
You can’t perform that action at this time.
0 commit comments