add tests

This commit is contained in:
Matias Alejo Garcia 2014-06-24 13:18:13 -03:00
commit 6b7b00769d
2 changed files with 69 additions and 60 deletions

View file

@ -147,11 +147,13 @@ describe('PublicKeyRing model', function() {
for (var i = 0; i < 2; i++) for (var i = 0; i < 2; i++)
w.generateAddress(isChange); w.generateAddress(isChange);
var as = w.getAddresses(); var as = w.getAddressesInfo();
as.length.should.equal(4); as.length.should.equal(4);
for (var j in as) { for (var j in as) {
var a = as[j]; var a = as[j];
a.isValid().should.equal(true); a.address.isValid().should.equal(true);
a.addressStr.should.equal(a.address.toString());
a.isChange.should.equal([false, false, true, true][j]);
} }
}); });

View file

@ -94,7 +94,14 @@ describe("Unit: controllerUtils", function() {
}); });
})); }));
it('should set the rootScope', inject(function(controllerUtils, $rootScope) {
controllerUtils.setupRootVariables(function() {
expect($rootScope.txAlertCount).to.be.equal(0);
expect($rootScope.insightError).to.be.equal(0);
expect($rootScope.isCollapsed).to.be.equal(0);
expect($rootScope.unitName).to.be.equal('bits');
});
}));
}); });
describe("Unit: Notification Service", function() { describe("Unit: Notification Service", function() {