mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-27 07:35:52 +00:00
Add unit test for prepareOrder and fix bugs
This commit is contained in:
@@ -4,6 +4,8 @@ const setupAPI = require('./setup-api');
|
||||
const address = require('./fixtures/addresses').ACCOUNT;
|
||||
const paymentSpecification = require('./fixtures/payment-specification');
|
||||
const paymentResponse = require('./fixtures/payment-response');
|
||||
const orderSpecification = require('./fixtures/order-specification');
|
||||
const orderResponse = require('./fixtures/order-response');
|
||||
const balancesResponse = require('./fixtures/balances-response');
|
||||
|
||||
describe('RippleAPI', function() {
|
||||
@@ -23,6 +25,19 @@ describe('RippleAPI', function() {
|
||||
});
|
||||
});
|
||||
|
||||
it('prepareOrder', function(done) {
|
||||
const instructions = {maxLedgerVersionOffset: 100};
|
||||
this.api.prepareOrder(address, orderSpecification, instructions,
|
||||
(error, response) => {
|
||||
if (error) {
|
||||
done(error);
|
||||
return;
|
||||
}
|
||||
assert.deepEqual(response, orderResponse);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('getBalances', function(done) {
|
||||
this.api.getBalances(address, {}, (error, response) => {
|
||||
if (error) {
|
||||
|
||||
Reference in New Issue
Block a user