Browse Source

test new address notification

activeAddress
Ivan Socolsky 10 years ago
parent
commit
afb96bf01e
  1. 11
      test/integration/server.js

11
test/integration/server.js

@ -601,16 +601,25 @@ describe('Copay server', function() {
}); });
}); });
it('should create address', function(done) { it.only('should create address', function(done) {
server.createAddress({}, function(err, address) { server.createAddress({}, function(err, address) {
should.not.exist(err); should.not.exist(err);
address.should.exist; address.should.exist;
address.address.should.equal('3KxttbKQQPWmpsnXZ3rB4mgJTuLnVR7frg'); address.address.should.equal('3KxttbKQQPWmpsnXZ3rB4mgJTuLnVR7frg');
address.isChange.should.be.false; address.isChange.should.be.false;
address.path.should.equal('m/2147483647/0/0'); address.path.should.equal('m/2147483647/0/0');
server.getNotifications({}, function(err, notifications) {
should.not.exist(err);
var notif = _.find(notifications, {
type: 'NewAddress'
});
should.exist(notif);
notif.length.should.equal(1);
notif[0].data.address.should.equal('3KxttbKQQPWmpsnXZ3rB4mgJTuLnVR7frg');
done(); done();
}); });
}); });
});
it('should create many addresses on simultaneous requests', function(done) { it('should create many addresses on simultaneous requests', function(done) {
var N = 5; var N = 5;

Loading…
Cancel
Save