@@ -29,28 +29,43 @@ const resultsTest = searchNodes(productQuery);
2929let expectedNodeCount = graphUtils . supportsGraphConceptsSearch ( ) ? 9 : 6 ;
3030let expectedEdgeCount = graphUtils . supportsGraphConceptsSearch ( ) ? 4 : 0 ;
3131
32+ let supportConcept = graphUtils . supportsGraphConceptsSearch ( ) ;
33+
3234let assertions = [
3335 test . assertEqual ( expectedNodeCount , resultsTest . total ) ,
3436 test . assertEqual ( expectedNodeCount , resultsTest . nodes . length ) ,
3537 test . assertEqual ( expectedEdgeCount , resultsTest . edges . length )
3638] ;
3739
38-
39- resultsTest . nodes . forEach ( node => {
4040 resultsTest . nodes . forEach ( node => {
41- if ( node . id === "/content/product100.json" ) {
42- assertions . push ( test . assertTrue ( node . hasRelationships , `Product 100 must have relationships flag in true. Result: ${ xdmp . toJsonString ( node ) } ` ) ) ;
43- }
44- else if ( node . id === "/content/product50.json" ) {
45- assertions . push ( test . assertFalse ( node . hasRelationships , `Product 50 must have relationships flag in false. Result: ${ xdmp . toJsonString ( node ) } ` ) ) ;
46- }
47- else if ( node . id === "/content/product60.json" ) {
48- assertions . push ( test . assertFalse ( node . hasRelationships , `Product 60 must have relationships flag in false. Result: ${ xdmp . toJsonString ( node ) } ` ) ) ;
49- }
50- if ( ! node . isConcept ) {
51- assertions . push ( test . assertTrue ( node . docUri . includes ( "product" ) ) ) ;
41+ if ( supportConcept ) {
42+ if ( node . id === "/content/product100.json" ) {
43+ assertions . push ( test . assertTrue ( node . hasRelationships , `Product 100 must have relationships flag in true. Result: ${ xdmp . toJsonString ( node ) } ` ) ) ;
44+ }
45+ else if ( node . id === "/content/product50.json" ) {
46+ assertions . push ( test . assertFalse ( node . hasRelationships , `Product 50 must have relationships flag in false. Result: ${ xdmp . toJsonString ( node ) } ` ) ) ;
47+ }
48+ else if ( node . id === "/content/product60.json" ) {
49+ assertions . push ( test . assertFalse ( node . hasRelationships , `Product 60 must have relationships flag in false. Result: ${ xdmp . toJsonString ( node ) } ` ) ) ;
50+ }
51+ if ( ! node . isConcept ) {
52+ assertions . push ( test . assertTrue ( node . docUri . includes ( "product" ) ) ) ;
53+ }
54+ } else {
55+ if ( node . id === "/content/product100.json" ) {
56+ assertions . push ( test . assertTrue ( node . hasRelationships , `Product 100 must have relationships flag in true. Result: ${ xdmp . toJsonString ( node ) } ` ) ) ;
57+ }
58+ else if ( node . id === "/content/product50.json" ) {
59+ assertions . push ( test . assertTrue ( node . hasRelationships , `Product 50 must have relationships flag in true. Result: ${ xdmp . toJsonString ( node ) } ` ) ) ;
60+ }
61+ else if ( node . id === "/content/product60.json" ) {
62+ assertions . push ( test . assertTrue ( node . hasRelationships , `Product 60 must have relationships flag in true. Result: ${ xdmp . toJsonString ( node ) } ` ) ) ;
63+ }
64+ if ( ! node . isConcept ) {
65+ assertions . push ( test . assertTrue ( node . docUri . includes ( "product" ) ) ) ;
66+ }
5267 }
68+
5369 } )
54- } )
5570
5671assertions ;
0 commit comments