Update tests
This commit is contained in:
parent
2989fe1da4
commit
0623c87727
5 changed files with 19 additions and 27 deletions
|
|
@ -66,6 +66,7 @@ describe("Unit: controllerUtils", function() {
|
|||
|
||||
|
||||
it(' should call updateAddressList ', inject(function(controllerUtils, $rootScope) {
|
||||
$rootScope.wallet = new FakeWallet();
|
||||
var spy = sinon.spy(controllerUtils, 'updateAddressList');
|
||||
controllerUtils.updateGlobalAddresses();
|
||||
sinon.assert.callCount(spy, 1);
|
||||
|
|
@ -77,24 +78,6 @@ describe("Unit: controllerUtils", function() {
|
|||
controllerUtils.updateGlobalAddresses();
|
||||
expect($rootScope.addrInfos[0].address).to.be.equal(Waddr);;
|
||||
}));
|
||||
|
||||
it('should set System Event Handlers', inject(function(controllerUtils, $rootScope, Socket) {
|
||||
var spy = sinon.spy(Socket, 'sysOn');
|
||||
$rootScope.wallet = new FakeWallet();
|
||||
controllerUtils.updateGlobalAddresses();
|
||||
sinon.assert.callCount(spy, 5);
|
||||
['error', 'reconnect_error', 'reconnect_failed', 'connect', 'reconnect'].forEach(function(e) {
|
||||
sinon.assert.calledWith(spy, e);
|
||||
});
|
||||
}));
|
||||
|
||||
it('should set Address Event Handlers', inject(function(controllerUtils, $rootScope, Socket) {
|
||||
var spy = sinon.spy(Socket, 'on');
|
||||
$rootScope.wallet = new FakeWallet();
|
||||
var Waddr = Object.keys($rootScope.wallet.balanceByAddr)[0];
|
||||
controllerUtils.updateGlobalAddresses();
|
||||
sinon.assert.calledWith(spy, Waddr);
|
||||
}));
|
||||
});
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue