paypro: tests - add more should() calls.
This commit is contained in:
parent
6505805196
commit
696323d496
1 changed files with 12 additions and 7 deletions
|
|
@ -643,9 +643,8 @@ describe('PayPro (in Wallet) model', function() {
|
||||||
should.exist(req);
|
should.exist(req);
|
||||||
delete w.paymentRequests[options.uri];
|
delete w.paymentRequests[options.uri];
|
||||||
w.receivePaymentRequest(options, req.pr, function(ntxid, merchantData) {
|
w.receivePaymentRequest(options, req.pr, function(ntxid, merchantData) {
|
||||||
if (!ntxid) {
|
should.exist(ntxid);
|
||||||
return done(new Error('No TX proposal.'));
|
should.exist(merchantData);
|
||||||
}
|
|
||||||
w._ntxid = ntxid;
|
w._ntxid = ntxid;
|
||||||
merchantData.pr.pd.payment_url.should.equal('https://localhost:8080/-/pay');
|
merchantData.pr.pd.payment_url.should.equal('https://localhost:8080/-/pay');
|
||||||
return done();
|
return done();
|
||||||
|
|
@ -656,9 +655,8 @@ describe('PayPro (in Wallet) model', function() {
|
||||||
var w = ppw;
|
var w = ppw;
|
||||||
should.exist(w);
|
should.exist(w);
|
||||||
w.sendPaymentTx(w._ntxid, function(txid, merchantData) {
|
w.sendPaymentTx(w._ntxid, function(txid, merchantData) {
|
||||||
if (!txid) {
|
should.exist(txid);
|
||||||
return done(new Error('No TX ID.'));
|
should.exist(merchantData);
|
||||||
}
|
|
||||||
should.exist(merchantData.ack);
|
should.exist(merchantData.ack);
|
||||||
merchantData.ack.memo.should.equal('Thank you for your payment!');
|
merchantData.ack.memo.should.equal('Thank you for your payment!');
|
||||||
return done();
|
return done();
|
||||||
|
|
@ -674,8 +672,9 @@ describe('PayPro (in Wallet) model', function() {
|
||||||
uri: uri,
|
uri: uri,
|
||||||
memo: memo
|
memo: memo
|
||||||
}, function(ntxid, merchantData) {
|
}, function(ntxid, merchantData) {
|
||||||
|
should.exist(ntxid);
|
||||||
|
should.exist(merchantData);
|
||||||
if (w.totalCopayers > 1) {
|
if (w.totalCopayers > 1) {
|
||||||
should.exist(ntxid);
|
|
||||||
console.log('Sent TX proposal to other copayers:');
|
console.log('Sent TX proposal to other copayers:');
|
||||||
console.log([ntxid, merchantData]);
|
console.log([ntxid, merchantData]);
|
||||||
return done();
|
return done();
|
||||||
|
|
@ -684,6 +683,7 @@ describe('PayPro (in Wallet) model', function() {
|
||||||
console.log(ntxid);
|
console.log(ntxid);
|
||||||
w.sendPaymentTx(ntxid, { memo: memo }, function(txid, merchantData) {
|
w.sendPaymentTx(ntxid, { memo: memo }, function(txid, merchantData) {
|
||||||
should.exist(txid);
|
should.exist(txid);
|
||||||
|
should.exist(merchantData);
|
||||||
console.log('TX sent:');
|
console.log('TX sent:');
|
||||||
console.log([ntxid, merchantData]);
|
console.log([ntxid, merchantData]);
|
||||||
return done();
|
return done();
|
||||||
|
|
@ -709,14 +709,17 @@ describe('PayPro (in Wallet) model', function() {
|
||||||
w.createTx(uri, commentText, function(ntxid, merchantData) {
|
w.createTx(uri, commentText, function(ntxid, merchantData) {
|
||||||
if (w.totalCopayers > 1) {
|
if (w.totalCopayers > 1) {
|
||||||
should.exist(ntxid);
|
should.exist(ntxid);
|
||||||
|
should.exist(merchantData);
|
||||||
console.log('Sent TX proposal to other copayers:');
|
console.log('Sent TX proposal to other copayers:');
|
||||||
console.log([ntxid, merchantData]);
|
console.log([ntxid, merchantData]);
|
||||||
return done();
|
return done();
|
||||||
} else {
|
} else {
|
||||||
console.log('Sending TX to merchant server:');
|
console.log('Sending TX to merchant server:');
|
||||||
console.log(ntxid);
|
console.log(ntxid);
|
||||||
|
should.exist(merchantData);
|
||||||
w.sendTx(ntxid, function(txid, merchantData) {
|
w.sendTx(ntxid, function(txid, merchantData) {
|
||||||
should.exist(txid);
|
should.exist(txid);
|
||||||
|
should.exist(merchantData);
|
||||||
console.log('TX sent:');
|
console.log('TX sent:');
|
||||||
console.log([ntxid, merchantData]);
|
console.log([ntxid, merchantData]);
|
||||||
return done();
|
return done();
|
||||||
|
|
@ -733,6 +736,7 @@ describe('PayPro (in Wallet) model', function() {
|
||||||
w.createTx(address, commentText, function(ntxid, merchantData) {
|
w.createTx(address, commentText, function(ntxid, merchantData) {
|
||||||
if (w.totalCopayers > 1) {
|
if (w.totalCopayers > 1) {
|
||||||
should.exist(ntxid);
|
should.exist(ntxid);
|
||||||
|
should.exist(merchantData);
|
||||||
console.log('Sent TX proposal to other copayers:');
|
console.log('Sent TX proposal to other copayers:');
|
||||||
console.log([ntxid, merchantData]);
|
console.log([ntxid, merchantData]);
|
||||||
return done();
|
return done();
|
||||||
|
|
@ -741,6 +745,7 @@ describe('PayPro (in Wallet) model', function() {
|
||||||
console.log(ntxid);
|
console.log(ntxid);
|
||||||
w.sendTx(ntxid, function(txid, merchantData) {
|
w.sendTx(ntxid, function(txid, merchantData) {
|
||||||
should.exist(txid);
|
should.exist(txid);
|
||||||
|
should.exist(merchantData);
|
||||||
console.log('TX sent:');
|
console.log('TX sent:');
|
||||||
console.log([ntxid, merchantData]);
|
console.log([ntxid, merchantData]);
|
||||||
return done();
|
return done();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue