mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-22 13:15:49 +00:00
Convert getPathFind and add unit test
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
const _ = require('lodash');
|
||||
const assert = require('assert-diff');
|
||||
const setupAPI = require('./setup-api');
|
||||
const address = require('./fixtures/addresses').ACCOUNT;
|
||||
const addresses = require('./fixtures/addresses');
|
||||
const hashes = require('./fixtures/hashes');
|
||||
const paymentSpecification = require('./fixtures/payment-specification');
|
||||
const paymentResponse = require('./fixtures/payment-response');
|
||||
@@ -30,6 +30,8 @@ const getSettingsResponse = require('./fixtures/get-settings-response');
|
||||
const getOrdersResponse = require('./fixtures/get-orders-response');
|
||||
const getOrderBookResponse = require('./fixtures/get-orderbook-response');
|
||||
const getServerInfoResponse = require('./fixtures/get-server-info-response');
|
||||
const getPathFindResponse = require('./fixtures/get-pathfind-response');
|
||||
const address = addresses.ACCOUNT;
|
||||
|
||||
function checkResult(expected, done, error, response) {
|
||||
if (error) {
|
||||
@@ -170,4 +172,22 @@ describe('RippleAPI', function() {
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('getPathFind', function(done) {
|
||||
const pathfind = {
|
||||
source: {
|
||||
address: address
|
||||
},
|
||||
destination: {
|
||||
address: addresses.OTHER_ACCOUNT,
|
||||
amount: {
|
||||
currency: 'USD',
|
||||
counterparty: addresses.ISSUER,
|
||||
value: '100'
|
||||
}
|
||||
}
|
||||
};
|
||||
this.api.getPathFind(pathfind,
|
||||
_.partial(checkResult, getPathFindResponse, done));
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user