settings: fix send in livenet
This commit is contained in:
parent
dcb78847d2
commit
c47318c728
4 changed files with 14 additions and 10 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue