@@ -4211,12 +4211,17 @@ describe('input', function() {
4211
4211
} ) ;
4212
4212
4213
4213
it ( 'should validate even if min value changes on-the-fly' , function ( ) {
4214
- scope . min = 10 ;
4214
+ scope . min = undefined ;
4215
4215
compileInput ( '<input type="number" ng-model="value" name="alias" min="{{min}}" />' ) ;
4216
+ expect ( inputElm ) . toBeValid ( ) ;
4216
4217
4217
4218
changeInputValueTo ( '15' ) ;
4218
4219
expect ( inputElm ) . toBeValid ( ) ;
4219
4220
4221
+ scope . min = 10 ;
4222
+ scope . $digest ( ) ;
4223
+ expect ( inputElm ) . toBeValid ( ) ;
4224
+
4220
4225
scope . min = 20 ;
4221
4226
scope . $digest ( ) ;
4222
4227
expect ( inputElm ) . toBeInvalid ( ) ;
@@ -4252,12 +4257,17 @@ describe('input', function() {
4252
4257
} ) ;
4253
4258
4254
4259
it ( 'should validate even if the ngMin value changes on-the-fly' , function ( ) {
4255
- scope . min = 10 ;
4260
+ scope . min = undefined ;
4256
4261
compileInput ( '<input type="number" ng-model="value" name="alias" ng-min="min" />' ) ;
4262
+ expect ( inputElm ) . toBeValid ( ) ;
4257
4263
4258
4264
changeInputValueTo ( '15' ) ;
4259
4265
expect ( inputElm ) . toBeValid ( ) ;
4260
4266
4267
+ scope . min = 10 ;
4268
+ scope . $digest ( ) ;
4269
+ expect ( inputElm ) . toBeValid ( ) ;
4270
+
4261
4271
scope . min = 20 ;
4262
4272
scope . $digest ( ) ;
4263
4273
expect ( inputElm ) . toBeInvalid ( ) ;
@@ -4294,12 +4304,17 @@ describe('input', function() {
4294
4304
} ) ;
4295
4305
4296
4306
it ( 'should validate even if max value changes on-the-fly' , function ( ) {
4297
- scope . max = 10 ;
4307
+ scope . max = undefined ;
4298
4308
compileInput ( '<input type="number" ng-model="value" name="alias" max="{{max}}" />' ) ;
4309
+ expect ( inputElm ) . toBeValid ( ) ;
4299
4310
4300
4311
changeInputValueTo ( '5' ) ;
4301
4312
expect ( inputElm ) . toBeValid ( ) ;
4302
4313
4314
+ scope . max = 10 ;
4315
+ scope . $digest ( ) ;
4316
+ expect ( inputElm ) . toBeValid ( ) ;
4317
+
4303
4318
scope . max = 0 ;
4304
4319
scope . $digest ( ) ;
4305
4320
expect ( inputElm ) . toBeInvalid ( ) ;
@@ -4335,12 +4350,17 @@ describe('input', function() {
4335
4350
} ) ;
4336
4351
4337
4352
it ( 'should validate even if the ngMax value changes on-the-fly' , function ( ) {
4338
- scope . max = 10 ;
4353
+ scope . max = undefined ;
4339
4354
compileInput ( '<input type="number" ng-model="value" name="alias" ng-max="max" />' ) ;
4355
+ expect ( inputElm ) . toBeValid ( ) ;
4340
4356
4341
4357
changeInputValueTo ( '5' ) ;
4342
4358
expect ( inputElm ) . toBeValid ( ) ;
4343
4359
4360
+ scope . max = 10 ;
4361
+ scope . $digest ( ) ;
4362
+ expect ( inputElm ) . toBeValid ( ) ;
4363
+
4344
4364
scope . max = 0 ;
4345
4365
scope . $digest ( ) ;
4346
4366
expect ( inputElm ) . toBeInvalid ( ) ;
0 commit comments