settings: fix send in livenet

This commit is contained in:
Manuel Araoz 2014-09-11 11:19:19 -07:00
commit c47318c728
4 changed files with 14 additions and 10 deletions

View file

@ -122,5 +122,9 @@ FakeWallet.prototype.toEncryptedObj = function() {
FakeWallet.prototype.close = function() {};
FakeWallet.prototype.getNetworkName = function() {
return 'testnet';
};
// TODO a try catch was here
module.exports = FakeWallet;

View file

@ -42,16 +42,16 @@ describe("Unit: Testing Directives", function() {
form = $scope.form;
}));
it('should validate with network', function() {
config.networkName = 'testnet';
it('should validate with network', inject(function($rootScope) {
$rootScope.wallet.getNetworkName = sinon.stub().returns('testnet');
form.address.$setViewValue('mkfTyEk7tfgV611Z4ESwDDSZwhsZdbMpVy');
expect(form.address.$invalid).to.equal(false);
});
it('should not validate with other network', function() {
config.networkName = 'livenet';
}));
it('should not validate with other network', inject(function($rootScope) {
$rootScope.wallet.getNetworkName = sinon.stub().returns('livenet');
form.address.$setViewValue('mkfTyEk7tfgV611Z4ESwDDSZwhsZdbMpVy');
expect(form.address.$invalid).to.equal(true);
});
}));
it('should not validate random', function() {
form.address.$setViewValue('thisisaninvalidaddress');
expect(form.address.$invalid).to.equal(true);