Browse Source

check also emits

activeAddress
Matias Alejo Garcia 10 years ago
parent
commit
0d36c3481b
  1. 9
      test/integration.js

9
test/integration.js

@ -1264,11 +1264,12 @@ describe('Copay server', function() {
}); });
it('should notify sign, acceptance, and broadcast', function(done) { it('should notify sign, acceptance, and broadcast, and emit', function(done) {
server.getPendingTxs({}, function(err, txs) { server.getPendingTxs({}, function(err, txs) {
var tx = txs[2]; var tx = txs[2];
var signatures = helpers.clientSign(tx, TestData.copayers[0].xPrivKey); var signatures = helpers.clientSign(tx, TestData.copayers[0].xPrivKey);
helpers.stubBlockExplorer(server, [], '1122334455'); helpers.stubBlockExplorer(server, [], '1122334455');
sinon.spy(server, 'emit');
server.signTx({ server.signTx({
txProposalId: tx.id, txProposalId: tx.id,
signatures: signatures, signatures: signatures,
@ -1280,12 +1281,16 @@ describe('Copay server', function() {
should.not.exist(err); should.not.exist(err);
var types = _.pluck(notifications, 'type'); var types = _.pluck(notifications, 'type');
types.should.deep.equal(['NewOutgoingTx', 'TxProposalFinallyAccepted', 'TxProposalAcceptedBy']); types.should.deep.equal(['NewOutgoingTx', 'TxProposalFinallyAccepted', 'TxProposalAcceptedBy']);
// Check also events
server.emit.getCall(0).args[0].type.should.equal('TxProposalAcceptedBy');
server.emit.getCall(1).args[0].type.should.equal('TxProposalFinallyAccepted');;
server.emit.getCall(2).args[0].type.should.equal('NewOutgoingTx');
done(); done();
}); });
}); });
}); });
}); });
}); });
describe('#removeWallet', function() { describe('#removeWallet', function() {

Loading…
Cancel
Save