@@ -1869,12 +1869,17 @@ describe('input', function() {
18691869 } ) ;
18701870
18711871 it ( 'should validate even if min value changes on-the-fly' , function ( ) {
1872- $rootScope . min = 10 ;
1872+ $rootScope . min = undefined ;
18731873 var inputElm = helper . compileInput ( '<input type="number" ng-model="value" name="alias" min="{{min}}" />' ) ;
1874+ expect ( inputElm ) . toBeValid ( ) ;
18741875
18751876 helper . changeInputValueTo ( '15' ) ;
18761877 expect ( inputElm ) . toBeValid ( ) ;
18771878
1879+ $rootScope . min = 10 ;
1880+ $rootScope . $digest ( ) ;
1881+ expect ( inputElm ) . toBeValid ( ) ;
1882+
18781883 $rootScope . min = 20 ;
18791884 $rootScope . $digest ( ) ;
18801885 expect ( inputElm ) . toBeInvalid ( ) ;
@@ -1910,12 +1915,17 @@ describe('input', function() {
19101915 } ) ;
19111916
19121917 it ( 'should validate even if the ngMin value changes on-the-fly' , function ( ) {
1913- $rootScope . min = 10 ;
1918+ $rootScope . min = undefined ;
19141919 var inputElm = helper . compileInput ( '<input type="number" ng-model="value" name="alias" ng-min="min" />' ) ;
1920+ expect ( inputElm ) . toBeValid ( ) ;
19151921
19161922 helper . changeInputValueTo ( '15' ) ;
19171923 expect ( inputElm ) . toBeValid ( ) ;
19181924
1925+ $rootScope . min = 10 ;
1926+ $rootScope . $digest ( ) ;
1927+ expect ( inputElm ) . toBeValid ( ) ;
1928+
19191929 $rootScope . min = 20 ;
19201930 $rootScope . $digest ( ) ;
19211931 expect ( inputElm ) . toBeInvalid ( ) ;
@@ -1952,12 +1962,17 @@ describe('input', function() {
19521962 } ) ;
19531963
19541964 it ( 'should validate even if max value changes on-the-fly' , function ( ) {
1955- $rootScope . max = 10 ;
1965+ $rootScope . max = undefined ;
19561966 var inputElm = helper . compileInput ( '<input type="number" ng-model="value" name="alias" max="{{max}}" />' ) ;
1967+ expect ( inputElm ) . toBeValid ( ) ;
19571968
19581969 helper . changeInputValueTo ( '5' ) ;
19591970 expect ( inputElm ) . toBeValid ( ) ;
19601971
1972+ $rootScope . max = 10 ;
1973+ $rootScope . $digest ( ) ;
1974+ expect ( inputElm ) . toBeValid ( ) ;
1975+
19611976 $rootScope . max = 0 ;
19621977 $rootScope . $digest ( ) ;
19631978 expect ( inputElm ) . toBeInvalid ( ) ;
@@ -1993,12 +2008,17 @@ describe('input', function() {
19932008 } ) ;
19942009
19952010 it ( 'should validate even if the ngMax value changes on-the-fly' , function ( ) {
1996- $rootScope . max = 10 ;
2011+ $rootScope . max = undefined ;
19972012 var inputElm = helper . compileInput ( '<input type="number" ng-model="value" name="alias" ng-max="max" />' ) ;
2013+ expect ( inputElm ) . toBeValid ( ) ;
19982014
19992015 helper . changeInputValueTo ( '5' ) ;
20002016 expect ( inputElm ) . toBeValid ( ) ;
20012017
2018+ $rootScope . max = 10 ;
2019+ $rootScope . $digest ( ) ;
2020+ expect ( inputElm ) . toBeValid ( ) ;
2021+
20022022 $rootScope . max = 0 ;
20032023 $rootScope . $digest ( ) ;
20042024 expect ( inputElm ) . toBeInvalid ( ) ;
0 commit comments