File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2683,14 +2683,17 @@ describe('input', function() {
26832683 } ) ;
26842684
26852685
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\'" />' ) ;
26882689
26892690 expect ( inputElm ) . toBeInvalid ( ) ;
2691+ expect ( $rootScope . form . cb . $error . required ) . toBe ( true ) ;
26902692
26912693 browserTrigger ( inputElm , 'click' ) ;
26922694 expect ( inputElm [ 0 ] . checked ) . toBe ( true ) ;
26932695 expect ( inputElm ) . toBeValid ( ) ;
2696+ expect ( $rootScope . form . cb . $error . required ) . toBeUndefined ( ) ;
26942697 } ) ;
26952698 } ) ;
26962699
You can’t perform that action at this time.
0 commit comments