add tests
This commit is contained in:
parent
f1257d054c
commit
6b7b00769d
2 changed files with 69 additions and 60 deletions
|
|
@ -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]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -94,17 +94,24 @@ 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() {
|
|
||||||
beforeEach(angular.mock.module('copayApp.services'));
|
beforeEach(angular.mock.module('copayApp.services'));
|
||||||
it('should contain a notification service', inject(function(notification) {
|
it('should contain a notification service', inject(function(notification) {
|
||||||
expect(notification).not.to.equal(null);
|
expect(notification).not.to.equal(null);
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("Unit: Backup Service", function() {
|
describe("Unit: Backup Service", function() {
|
||||||
beforeEach(angular.mock.module('copayApp.services'));
|
beforeEach(angular.mock.module('copayApp.services'));
|
||||||
it('should contain a backup service', inject(function(backupService) {
|
it('should contain a backup service', inject(function(backupService) {
|
||||||
expect(backupService).not.to.equal(null);
|
expect(backupService).not.to.equal(null);
|
||||||
|
|
@ -115,9 +122,9 @@ describe("Unit: Backup Service", function() {
|
||||||
backupService.download(new FakeWallet());
|
backupService.download(new FakeWallet());
|
||||||
expectation.once();
|
expectation.once();
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("Unit: isMobile Service", function() {
|
describe("Unit: isMobile Service", function() {
|
||||||
beforeEach(angular.mock.module('copayApp.services'));
|
beforeEach(angular.mock.module('copayApp.services'));
|
||||||
it('should contain a isMobile service', inject(function(isMobile) {
|
it('should contain a isMobile service', inject(function(isMobile) {
|
||||||
expect(isMobile).not.to.equal(null);
|
expect(isMobile).not.to.equal(null);
|
||||||
|
|
@ -131,4 +138,4 @@ describe("Unit: isMobile Service", function() {
|
||||||
});
|
});
|
||||||
isMobile.any().should.equal(true);
|
isMobile.any().should.equal(true);
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue