File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -288,14 +288,14 @@ module.exports = () => {
288288 expect ( unfilteredResponse . status ) . to . equal ( 200 ) ;
289289
290290 // When a log has no rootLogId the logs adapter will set the row itself as the root log
291- let rootLogs = unfilteredResponse . body . data . filter ( ( { rootLogId, id } ) => rootLogId === id ) ;
292-
293- expect ( rootLogs ) . to . lengthOf ( 8 ) ; // limit = 10; 10-2 = 8
291+ let hasChildLogs = unfilteredResponse . body . data . some ( ( { rootLogId, id } ) => rootLogId !== id ) ;
292+ expect ( hasChildLogs ) . to . be . true ;
294293
295294 const filteredResponse = await request ( server ) . get ( '/api/logs?page[offset]=0&page[limit]=10&filter[rootOnly]=true' ) ;
296295 expect ( filteredResponse . status ) . to . equal ( 200 ) ;
297- rootLogs = filteredResponse . body . data . filter ( ( { rootLogId, id } ) => rootLogId === id ) ;
298- expect ( rootLogs ) . to . lengthOf ( 10 ) ; // all of the child data has now been excluded
296+
297+ hasChildLogs = filteredResponse . body . data . every ( ( { rootLogId, id } ) => rootLogId !== id ) ;
298+ expect ( hasChildLogs ) . to . be . false ;
299299 } )
300300
301301 it ( 'should successfully ignore rootOnly filters if rootLog is provided' , async ( ) => {
You can’t perform that action at this time.
0 commit comments