@@ -451,7 +451,7 @@ describe('Elasticsearch pagination', () => {
451451 expect ( entityTypeMap . get ( 'Vocabulary' ) ) . toBe ( entitiesCounter . Vocabulary ) ;
452452 expect ( entityTypeMap . get ( 'RetentionRule' ) ) . toBe ( entitiesCounter . RetentionRule ) ;
453453 expect ( data . edges . length ) . toEqual ( entitiesCounterTotal ) ;
454- const filterBaseTypes = R . uniq ( R . map ( ( e ) => e . node . base_type , data . edges ) ) ;
454+ const filterBaseTypes = R . uniq ( data . edges . map ( ( e ) => e . node . base_type ) ) ;
455455 expect ( filterBaseTypes . length ) . toEqual ( 1 ) ;
456456 expect ( R . head ( filterBaseTypes ) ) . toEqual ( 'ENTITY' ) ;
457457 } ) ;
@@ -507,7 +507,7 @@ describe('Elasticsearch pagination', () => {
507507 const data = await elPaginate ( testContext , ADMIN_USER , READ_ENTITIES_INDICES , { types : [ 'Malware' ] } ) ;
508508 expect ( data ) . not . toBeNull ( ) ;
509509 expect ( data . edges . length ) . toEqual ( entitiesCounter . Malware ) ;
510- const nodes = R . map ( ( e ) => e . node , data . edges ) ;
510+ const nodes = data . edges . map ( ( e ) => e . node ) ;
511511 const malware = nodes . find ( ( n ) => ( n . x_opencti_stix_ids ?? [ ] ) . includes ( 'malware--faa5b705-cf44-4e50-8472-29e5fec43c3c' ) ) ;
512512 expect ( malware ) . not . toBeUndefined ( ) ;
513513 expect ( malware . internal_id ) . not . toBeNull ( ) ;
@@ -756,7 +756,7 @@ describe('Elasticsearch pagination', () => {
756756 const { type, size } = testingSet [ index ] ;
757757 expect ( entityTypeMap . get ( type ) ) . toBe ( size ) ;
758758 }
759- const createdDates = R . map ( ( e ) => e . node . created , data . edges ) ;
759+ const createdDates = data . edges . map ( ( e ) => e . node . created ) ;
760760 let previousCreatedDate = null ;
761761 for ( let index = 0 ; index < createdDates . length ; index += 1 ) {
762762 const createdDate = createdDates [ index ] ;
@@ -783,7 +783,7 @@ describe('Elasticsearch pagination', () => {
783783 orderMode : 'desc' ,
784784 } ) ;
785785 expect ( data . edges . length ) . toEqual ( 11 ) ;
786- const markings = R . map ( ( e ) => e . node . definition , data . edges ) ;
786+ const markings = data . edges . map ( ( e ) => e . node . definition ) ;
787787 expect ( markings [ 0 ] ) . toEqual ( 'TLP:TEST' ) ;
788788 expect ( markings [ 1 ] ) . toEqual ( 'TLP:RED' ) ;
789789 expect ( markings [ 2 ] ) . toEqual ( 'TLP:GREEN' ) ;
@@ -898,7 +898,7 @@ describe('Elasticsearch pagination', () => {
898898 expect ( metaByEntityType [ 'kill-chain-phase' ] . length ) . toEqual ( relationsCounter [ 'kill-chain-phase' ] ) ;
899899 expect ( metaByEntityType [ 'operating-system' ] . length ) . toEqual ( relationsCounter [ 'operating-system' ] ) ;
900900 expect ( data . edges . length ) . toEqual ( totalCountRelations ) ;
901- let filterBaseTypes = R . uniq ( R . map ( ( e ) => e . node . base_type , data . edges ) ) ;
901+ let filterBaseTypes = R . uniq ( data . edges . map ( ( e ) => e . node . base_type ) ) ;
902902 expect ( filterBaseTypes . length ) . toEqual ( 1 ) ;
903903 expect ( R . head ( filterBaseTypes ) ) . toEqual ( 'RELATION' ) ;
904904 // Same query with no pagination
@@ -927,7 +927,7 @@ describe('Elasticsearch pagination', () => {
927927 expect ( entityTypeMap . get ( 'operating-system' ) ) . toBe ( relationsCounter [ 'operating-system' ] ) ;
928928 expect ( entityTypeMap . get ( 'stix-sighting-relationship' ) ) . toBe ( relationsCounter [ 'stix-sighting-relationship' ] ) ;
929929 expect ( data . length ) . toEqual ( totalCountRelations ) ;
930- filterBaseTypes = R . uniq ( R . map ( ( e ) => e . base_type , data ) ) ;
930+ filterBaseTypes = R . uniq ( data . map ( ( e ) => e . base_type ) ) ;
931931 expect ( filterBaseTypes . length ) . toEqual ( 1 ) ;
932932 expect ( R . head ( filterBaseTypes ) ) . toEqual ( 'RELATION' ) ;
933933 } ) ;
0 commit comments