Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 6a89329

Browse files
committed
test(input): test ngMax and/or ngMin validation while the initial value is not a contant
1 parent 8b4d85c commit 6a89329

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

test/ng/directive/inputSpec.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -4206,10 +4206,14 @@ describe('input', function() {
42064206
});
42074207

42084208
it('should validate even if the ngMin value changes on-the-fly', function() {
4209-
scope.min = 10;
4209+
scope.min = undefined;
42104210
compileInput('<input type="number" ng-model="value" name="alias" ng-min="min" />');
4211+
expect(inputElm).toBeValid();
42114212

42124213
changeInputValueTo('15');
4214+
4215+
scope.min = 10;
4216+
scope.$digest();
42134217
expect(inputElm).toBeValid();
42144218

42154219
scope.min = 20;
@@ -4293,10 +4297,14 @@ describe('input', function() {
42934297
});
42944298

42954299
it('should validate even if the ngMax value changes on-the-fly', function() {
4296-
scope.max = 10;
4300+
scope.max = undefined;
42974301
compileInput('<input type="number" ng-model="value" name="alias" ng-max="max" />');
4302+
expect(inputElm).toBeValid();
42984303

42994304
changeInputValueTo('5');
4305+
4306+
scope.max = 10;
4307+
scope.$digest();
43004308
expect(inputElm).toBeValid();
43014309

43024310
scope.max = 0;

0 commit comments

Comments
 (0)