@@ -571,7 +571,7 @@ describe('#integration-rx summary', () => {
571
571
. toPromise ( )
572
572
expect ( summary ) . toBeDefined ( )
573
573
expect ( summary . hasPlan ( ) ) . toBeTruthy ( )
574
- expect ( summary . plan . operatorType ) . toBe ( 'ProduceResults' )
574
+ expect ( summary . plan . operatorType ) . toContain ( 'ProduceResults' )
575
575
expect ( summary . plan . identifiers ) . toEqual ( [ 'n' ] )
576
576
expect ( summary . hasProfile ( ) ) . toBeFalsy ( )
577
577
expect ( summary . profile ) . toBeFalsy ( )
@@ -592,10 +592,10 @@ describe('#integration-rx summary', () => {
592
592
. toPromise ( )
593
593
expect ( summary ) . toBeDefined ( )
594
594
expect ( summary . hasPlan ( ) ) . toBeTruthy ( )
595
- expect ( summary . plan . operatorType ) . toBe ( 'ProduceResults' )
595
+ expect ( summary . plan . operatorType ) . toContain ( 'ProduceResults' )
596
596
expect ( summary . plan . identifiers ) . toEqual ( [ 'n' ] )
597
597
expect ( summary . hasProfile ( ) ) . toBeTruthy ( )
598
- expect ( summary . profile . operatorType ) . toBe ( 'ProduceResults' )
598
+ expect ( summary . profile . operatorType ) . toContain ( 'ProduceResults' )
599
599
expect ( summary . profile . identifiers ) . toEqual ( [ 'n' ] )
600
600
}
601
601
@@ -727,25 +727,18 @@ describe('#integration-rx summary', () => {
727
727
}
728
728
729
729
async function dropConstraintsAndIndices ( driver ) {
730
- function getName ( record ) {
731
- const obj = record . toObject ( )
732
- const name = obj . description || obj . name
733
- if ( ! name ) {
734
- throw new Error ( 'unable to identify name of the constraint/index' )
735
- }
736
- return name
737
- }
738
-
739
730
const session = driver . session ( )
740
731
try {
741
732
const constraints = await session . run ( 'CALL db.constraints()' )
742
733
for ( let i = 0 ; i < constraints . records . length ; i ++ ) {
743
- await session . run ( `DROP ${ getName ( constraints . records [ i ] ) } ` )
734
+ const name = constraints . records [ i ] . toObject ( ) . name
735
+ await session . run ( 'DROP CONSTRAINT ' + name ) // ${getName(constraints.records[i])}`)
744
736
}
745
737
746
738
const indices = await session . run ( 'CALL db.indexes()' )
747
739
for ( let i = 0 ; i < indices . records . length ; i ++ ) {
748
- await session . run ( `DROP INDEX ${ getName ( indices . records [ i ] ) } ` )
740
+ const name = indices . records [ i ] . toObject ( ) . name
741
+ await session . run ( 'DROP INDEX ' + name ) // ${getName(constraints.records[i])}`)
749
742
}
750
743
} finally {
751
744
await session . close ( )
0 commit comments