File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -2683,14 +2683,17 @@ describe('input', function() {
2683
2683
} ) ;
2684
2684
2685
2685
2686
- it ( 'should set the ngTrueValue when required directive is present' , function ( ) {
2687
- var inputElm = helper . compileInput ( '<input type="checkbox" ng-model="value" required ng-true-value="\'yes\'" />' ) ;
2686
+ it ( 'should pass validation for "required" when trueValue is a string' , function ( ) {
2687
+ var inputElm = helper . compileInput ( '<input type="checkbox" required name="cb"' +
2688
+ 'ng-model="value" ng-true-value="\'yes\'" />' ) ;
2688
2689
2689
2690
expect ( inputElm ) . toBeInvalid ( ) ;
2691
+ expect ( $rootScope . form . cb . $error . required ) . toBe ( true ) ;
2690
2692
2691
2693
browserTrigger ( inputElm , 'click' ) ;
2692
2694
expect ( inputElm [ 0 ] . checked ) . toBe ( true ) ;
2693
2695
expect ( inputElm ) . toBeValid ( ) ;
2696
+ expect ( $rootScope . form . cb . $error . required ) . toBeUndefined ( ) ;
2694
2697
} ) ;
2695
2698
} ) ;
2696
2699
You can’t perform that action at this time.
0 commit comments