Skip to content

Commit c9a45cf

Browse files
committed
Fix up all the test for woql.js (except result api)
1 parent 3511915 commit c9a45cf

File tree

1 file changed

+9
-19
lines changed

1 file changed

+9
-19
lines changed

test/woqlQuery.spec.js

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ describe('woql query object', function () {
592592

593593
const woqlObject=WOQL.limit(2).start(10);
594594

595-
const jsonObj={ limit: [ 3, { start: [ 0, {} ] } ] };
595+
const jsonObj={ limit: [ 3, { start: [ 10, {} ] } ] };
596596

597597
expect(woqlObject.setLimit(3).json()).to.eql(jsonObj);
598598

@@ -618,35 +618,25 @@ describe('woql query object', function () {
618618

619619
})
620620

621-
it('check the getSelect method',function(){
621+
it('check the getSelectVariables method',function(){
622622
global.sandbox.stub(axios, "get").returns(Promise.resolve({status:200, data: {}}));
623623

624624
const woqlObject=WOQL.select("V1", WOQL.triple("a", "b", "c"));
625625

626-
expect(woqlObject.getSelect()).to.eql("V1");
626+
expect(woqlObject.getSelectVariables()).to.eql(["V1"]);
627627

628628
})
629629

630-
it('check the context method',function(){
630+
it('check the context and getContext method',function(){
631631
global.sandbox.stub(axios, "get").returns(Promise.resolve({status:200, data: {}}));
632632

633+
const contextObj = {"@import": "https://terminusdb/contexts/woql/syntax/context.jsonld",
634+
"@propagate": true,
635+
"db" : "http://localhost:6363/testDB004/"}
633636
const woqlObject=WOQL.limit(2).start(0);
637+
woqlObject.context(contextObj);
634638

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);
650640

651641
})
652642

0 commit comments

Comments
 (0)