Skip to content

Commit 28f3ca0

Browse files
committed
test(input): failing min/max databinding test
1 parent 75345e3 commit 28f3ca0

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

test/ng/directive/inputSpec.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,19 @@ describe('input', function() {
733733
changeInputValueTo('aaa');
734734
expect(scope.value).toBe('aaa');
735735
});
736+
737+
738+
it('should be updatable via binding', function(){
739+
scope.boundLength = 3;
740+
compileInput('<input type="text" ng-model="value" ng-minlength="boundLength" />');
741+
742+
changeInputValueTo('aaa');
743+
expect(scope.value).toBe('aaa');
744+
745+
scope.boundLength = 6;
746+
scope.$digest();
747+
expect(scope.value).toBeUndefined();
748+
});
736749
});
737750

738751

@@ -747,6 +760,19 @@ describe('input', function() {
747760
changeInputValueTo('aaa');
748761
expect(scope.value).toBe('aaa');
749762
});
763+
764+
765+
it('should be updatable via binding', function(){
766+
scope.boundLength = 6;
767+
compileInput('<input type="text" ng-model="value" ng-maxlength="boundLength" />');
768+
769+
changeInputValueTo('aaa');
770+
expect(scope.value).toBe('aaa');
771+
772+
scope.boundLength = 3;
773+
scope.$digest();
774+
expect(scope.value).toBeUndefined();
775+
});
750776
});
751777

752778

0 commit comments

Comments
 (0)