Add test for TxProposal

This commit is contained in:
Matias Pando 2015-01-23 12:08:09 -03:00
commit 63b4f2c649
2 changed files with 50 additions and 12 deletions

View file

@ -74,6 +74,7 @@ describe('HDParams model', function() {
});
it('should count generation indexes', function() {
var j = new HDParams();
j.copayerIndex = 1;
@ -121,3 +122,28 @@ describe('HDParams model', function() {
})
});
describe('#checkRange', function() {
it('should throw an error', function() {
var hd = new HDParams();
(function() {
hd.checkRange(60, true);
}).should.throw('Out of bounds');
});
it('should throw an error', function() {
var hd = new HDParams();
(function() {
hd.checkRange(60, false);
}).should.throw('Out of bounds');
});
it('should not throw an error', function() {
var hd = new HDParams();
hd.checkRange(0, false);
hd.checkRange(0, true);
});
});