Skip to content

Commit

Permalink
test: add NodeStateUpdate sanity test
Browse files Browse the repository at this point in the history
  • Loading branch information
sangaman committed Apr 13, 2019
1 parent 0e47177 commit 7112be0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/p2p/sanity.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,17 @@ describe('P2P Sanity Tests', () => {
expect(listPeersResult[0].nodePubKey).to.equal(nodeTwo.nodePubKey);
});

it('should update the node state', (done) => {
const raidenAddress = '0xbb9bc244d798123fde783fcc1c72d3bb8c189413';
const nodeTwoPeer = nodeOne['pool'].getPeer(nodeTwo.nodePubKey);
nodeTwoPeer.on('nodeStateUpdate', () => {
expect(nodeTwoPeer['nodeState']!.raidenAddress).to.equal(raidenAddress);
done();
});

nodeTwo['pool'].updateRaidenAddress(raidenAddress);
});

it('should fail connecting to the same node', async () => {
await expect(nodeOne.service.connect({ nodeUri: nodeTwoUri, retryConnecting: false }))
.to.be.rejectedWith('already connected');
Expand Down

0 comments on commit 7112be0

Please sign in to comment.