@@ -592,7 +592,7 @@ describe('woql query object', function () {
592
592
593
593
const woqlObject = WOQL . limit ( 2 ) . start ( 10 ) ;
594
594
595
- const jsonObj = { limit : [ 3 , { start : [ 0 , { } ] } ] } ;
595
+ const jsonObj = { limit : [ 3 , { start : [ 10 , { } ] } ] } ;
596
596
597
597
expect ( woqlObject . setLimit ( 3 ) . json ( ) ) . to . eql ( jsonObj ) ;
598
598
@@ -618,35 +618,25 @@ describe('woql query object', function () {
618
618
619
619
} )
620
620
621
- it ( 'check the getSelect method' , function ( ) {
621
+ it ( 'check the getSelectVariables method' , function ( ) {
622
622
global . sandbox . stub ( axios , "get" ) . returns ( Promise . resolve ( { status :200 , data : { } } ) ) ;
623
623
624
624
const woqlObject = WOQL . select ( "V1" , WOQL . triple ( "a" , "b" , "c" ) ) ;
625
625
626
- expect ( woqlObject . getSelect ( ) ) . to . eql ( "V1" ) ;
626
+ expect ( woqlObject . getSelectVariables ( ) ) . to . eql ( [ "V1" ] ) ;
627
627
628
628
} )
629
629
630
- it ( 'check the context method' , function ( ) {
630
+ it ( 'check the context and getContext method' , function ( ) {
631
631
global . sandbox . stub ( axios , "get" ) . returns ( Promise . resolve ( { status :200 , data : { } } ) ) ;
632
632
633
+ const contextObj = { "@import" : "https://terminusdb/contexts/woql/syntax/context.jsonld" ,
634
+ "@propagate" : true ,
635
+ "db" : "http://localhost:6363/testDB004/" }
633
636
const woqlObject = WOQL . limit ( 2 ) . start ( 0 ) ;
637
+ woqlObject . context ( contextObj ) ;
634
638
635
- //const jsonObj={ limit: [ 3, { start: [ 0, {} ] } ] };
636
- console . log ( woqlObject . context ( "context" ) . json ( ) )
637
-
638
- //expect(woqlObject.setContext("context").json()).to.eql(jsonObj);
639
-
640
- } )
641
-
642
- it ( 'check the getContext method' , function ( ) {
643
- global . sandbox . stub ( axios , "get" ) . returns ( Promise . resolve ( { status :200 , data : { } } ) ) ;
644
-
645
- const woqlObject = WOQL . context ( "context" ) ;
646
-
647
- const jsonObj = { limit : [ 3 , { start : [ 0 , { } ] } ] } ;
648
-
649
- expect ( woqlObject . getContext ( ) ) . to . eql ( jsonObj ) ;
639
+ expect ( woqlObject . getContext ( ) ) . to . eql ( contextObj ) ;
650
640
651
641
} )
652
642
0 commit comments