@@ -598,4 +598,56 @@ describe('woql query object', function () {
598
598
599
599
} )
600
600
601
+ it ( 'check the getLimit method' , function ( ) {
602
+ global . sandbox . stub ( axios , "get" ) . returns ( Promise . resolve ( { status :200 , data : { } } ) ) ;
603
+
604
+ const woqlObject = WOQL . limit ( 2 ) . start ( 0 ) ;
605
+
606
+ expect ( woqlObject . getLimit ( ) ) . to . eql ( 2 ) ;
607
+
608
+ } )
609
+
610
+ it ( 'check the hasSelect method' , function ( ) {
611
+ global . sandbox . stub ( axios , "get" ) . returns ( Promise . resolve ( { status :200 , data : { } } ) ) ;
612
+
613
+ const woqlObjectTrue = WOQL . select ( "V1" , WOQL . triple ( "a" , "b" , "c" ) ) ;
614
+ const woqlObjectFalse = WOQL . limit ( 2 ) . start ( 0 ) ;
615
+
616
+ expect ( woqlObjectTrue . hasSelect ( ) ) . to . eql ( true ) ;
617
+ expect ( woqlObjectFalse . hasSelect ( ) ) . to . eql ( false ) ;
618
+
619
+ } )
620
+
621
+ it ( 'check the getSelect method' , function ( ) {
622
+ global . sandbox . stub ( axios , "get" ) . returns ( Promise . resolve ( { status :200 , data : { } } ) ) ;
623
+
624
+ const woqlObject = WOQL . select ( "V1" , WOQL . triple ( "a" , "b" , "c" ) ) ;
625
+
626
+ expect ( woqlObject . getSelect ( ) ) . to . eql ( "V1" ) ;
627
+
628
+ } )
629
+
630
+ it ( 'check the context method' , function ( ) {
631
+ global . sandbox . stub ( axios , "get" ) . returns ( Promise . resolve ( { status :200 , data : { } } ) ) ;
632
+
633
+ const woqlObject = WOQL . limit ( 2 ) . start ( 0 ) ;
634
+
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 ) ;
650
+
651
+ } )
652
+
601
653
} ) ;
0 commit comments