Added test to transactionHistoryCvs
This commit is contained in:
parent
ae9b79b843
commit
3c238ca064
3 changed files with 80 additions and 13 deletions
|
|
@ -2472,6 +2472,7 @@ describe('Wallet model', function() {
|
|||
});
|
||||
});
|
||||
|
||||
|
||||
// TODO
|
||||
describe.skip('#onPayProPaymentAck', function() {
|
||||
it('should emit', function() {
|
||||
|
|
@ -2484,6 +2485,69 @@ describe('Wallet model', function() {
|
|||
});
|
||||
});
|
||||
|
||||
describe('#getTransactionHistoryCsv', function() {
|
||||
it.only('should return list of txs', function(done) {
|
||||
var w = cachedCreateW2();
|
||||
var txs = [{
|
||||
vin: [{
|
||||
addr: 'addr_in_1',
|
||||
valueSat: 1000
|
||||
}],
|
||||
vout: [{
|
||||
scriptPubKey: {
|
||||
addresses: ['addr_out_1'],
|
||||
},
|
||||
value: '0.00000900',
|
||||
}],
|
||||
fees: 0.00000100
|
||||
}, {
|
||||
vin: [{
|
||||
addr: 'addr_in_2',
|
||||
valueSat: 2000
|
||||
}],
|
||||
vout: [{
|
||||
scriptPubKey: {
|
||||
addresses: ['addr_out_2'],
|
||||
},
|
||||
value: '0.00001900',
|
||||
}],
|
||||
fees: 0.00000100
|
||||
}, {
|
||||
vin: [{
|
||||
addr: 'addr_in_1',
|
||||
valueSat: 3000
|
||||
|
||||
}],
|
||||
vout: [{
|
||||
scriptPubKey: {
|
||||
addresses: ['addr_out_2'],
|
||||
},
|
||||
value: '0.00002900',
|
||||
|
||||
}],
|
||||
fees: 0.00000100
|
||||
}];
|
||||
|
||||
w.blockchain.getTransactions = sinon.stub().yields(null, {
|
||||
items: txs,
|
||||
totalItems: txs.length,
|
||||
});
|
||||
w.getAddressesInfo = sinon.stub().returns([{
|
||||
addressStr: 'addr_in_1'
|
||||
}, {
|
||||
addressStr: 'addr_out_2'
|
||||
}]);
|
||||
|
||||
w.getTransactionHistoryCsv(function(data) {
|
||||
data.should.exist;
|
||||
data.should.equal('data:text/csv;charset=utf-8,Date,Amount(bits),Action,AddressTo,Comment,Signers\n,9,sent,"addr_out_1",\n,19,received,,\n,29,moved,"addr_out_2",\n');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
describe.skip('#read', function() {
|
||||
var network, blockchain;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue