Merge pull request #1791 from matiu/bug/use-all-funds

Fix #1789 - use all funds button
This commit is contained in:
Esteban Ordano 2014-11-12 22:17:50 -03:00
commit 4726570b7a
8 changed files with 43 additions and 72 deletions

View file

@ -439,24 +439,12 @@ describe("Unit: Controllers", function() {
expect(scope.isMobile).not.to.equal(null);
});
it('should autotop balance correctly', function() {
scope.topAmount(form);
scope.setTopAmount(form);
form.amount.$setViewValue(123356);
expect(scope.amount).to.equal(123356);
expect(form.amount.$invalid).to.equal(false);
expect(form.amount.$pristine).to.equal(false);
});
it('should return available amount', function() {
form.amount.$setViewValue(123356);
var amount = scope.getAvailableAmount();
expect(amount).to.equal(123356);
});
it('should return 0 if available amount below minimum fee', function() {
inject(function($compile, $rootScope, $controller) {
$rootScope.availableBalance = 1;
});
var amount = scope.getAvailableAmount();
expect(amount).to.equal(0);
});
});
describe('Import Controller', function() {