Skip to content

Commit 13e1d1d

Browse files
authored
feat: add unit tests for order charges (#91)
1 parent 9c34f72 commit 13e1d1d

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

test/kiteconnect-mocks

test/test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ function testSuite(){
174174

175175
// orderMargins
176176
.post("/margins/orders")
177-
.query({ mode: "compact" })
177+
.query({ mode: null })
178178
.reply(200, parseJson("order_margins.json"))
179179

180180

@@ -658,12 +658,16 @@ function testSuite(){
658658
"order_type": "MARKET",
659659
"quantity": 1
660660
}
661-
], "compact")
661+
])
662662
.then(function(response) {
663663
expect(response).to.have.nested.property("[0].type");
664664
expect(response).to.have.nested.property("[0].var");
665665
expect(response).to.have.nested.property("[0].span");
666666
expect(response).to.have.nested.property("[0].exposure");
667+
// Order charges
668+
expect(response).to.have.nested.property("[0].charges.total");
669+
expect(response).to.have.nested.property("[0].charges.transaction_tax");
670+
expect(response).to.have.nested.property("[0].charges.gst.total");
667671
return done();
668672
}).catch(done);
669673
})

0 commit comments

Comments
 (0)