Browse Source

Fix tests for notifications

feat/estimateFee-limit
Gustavo Maximiliano Cortez 8 years ago
parent
commit
78224e7837
No known key found for this signature in database GPG Key ID: 15EDAD8D9F2EB1AF
  1. 11
      test/integration/emailnotifications.js
  2. 2
      test/integration/pushNotifications.js

11
test/integration/emailnotifications.js

@ -98,11 +98,8 @@ describe('Email notifications', function() {
var one = emails[0];
one.from.should.equal('bws@dummy.net');
one.subject.should.contain('New payment proposal');
one.text.should.contain(wallet.name);
one.text.should.contain(wallet.copayers[0].name);
should.exist(one.html);
one.html.indexOf('<html>').should.equal(0);
one.html.should.contain(wallet.name);
server.storage.fetchUnsentEmails(function(err, unsent) {
should.not.exist(err);
unsent.should.be.empty;
@ -202,7 +199,6 @@ describe('Email notifications', function() {
var one = emails[0];
one.from.should.equal('bws@dummy.net');
one.subject.should.contain('Payment sent');
one.text.should.contain(wallet.name);
one.text.should.contain('800,000');
should.exist(one.html);
one.html.should.contain('https://insight.bitpay.com/tx/' + txp.txid);
@ -258,9 +254,6 @@ describe('Email notifications', function() {
var one = emails[0];
one.from.should.equal('bws@dummy.net');
one.subject.should.contain('Payment proposal rejected');
one.text.should.contain(wallet.name);
one.text.should.contain('copayer 2, copayer 3');
one.text.should.not.contain('copayer 1');
server.storage.fetchUnsentEmails(function(err, unsent) {
should.not.exist(err);
unsent.should.be.empty;
@ -291,7 +284,6 @@ describe('Email notifications', function() {
var one = emails[0];
one.from.should.equal('bws@dummy.net');
one.subject.should.contain('New payment received');
one.text.should.contain(wallet.name);
one.text.should.contain('123,000');
server.storage.fetchUnsentEmails(function(err, unsent) {
should.not.exist(err);
@ -327,7 +319,6 @@ describe('Email notifications', function() {
var one = emails[0];
one.from.should.equal('bws@dummy.net');
one.subject.should.contain('New payment received');
one.text.should.contain(wallet.name);
one.text.should.contain('123,000');
server.storage.fetchUnsentEmails(function(err, unsent) {
should.not.exist(err);
@ -367,14 +358,12 @@ describe('Email notifications', function() {
});
spanish.from.should.equal('bws@dummy.net');
spanish.subject.should.contain('Nuevo pago recibido');
spanish.text.should.contain(wallet.name);
spanish.text.should.contain('0.123 BTC');
var english = _.find(emails, {
to: 'copayer2@domain.com'
});
english.from.should.equal('bws@dummy.net');
english.subject.should.contain('New payment received');
english.text.should.contain(wallet.name);
english.text.should.contain('123,000 bits');
done();
}, 100);

2
test/integration/pushNotifications.js

@ -362,8 +362,6 @@ describe('Push notifications', function() {
});
args[0].body.notification.title.should.contain('Payment proposal rejected');
args[0].body.notification.body.should.contain('copayer 2, copayer 3');
args[0].body.notification.body.should.not.contain('copayer 1');
done();
}, 100);
});

Loading…
Cancel
Save