File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,25 @@ describe('input', function() {
72
72
expect ( $rootScope . form . $$renameControl ) . not . toHaveBeenCalled ( ) ;
73
73
} ) ;
74
74
75
+
76
+ it ( 'should not set the `val` property when the value is equal to the current value' , inject ( function ( $rootScope , $compile ) {
77
+ // This is a workaround for Firefox validation. Look at #12102.
78
+ var input = jqLite ( '<input type="text" ng-model="foo" required/>' ) ;
79
+ var setterCalls = 0 ;
80
+ $rootScope . foo = '' ;
81
+ Object . defineProperty ( input [ 0 ] , 'value' , {
82
+ get : function ( ) {
83
+ return '' ;
84
+ } ,
85
+ set : function ( ) {
86
+ setterCalls ++ ;
87
+ }
88
+ } ) ;
89
+ $compile ( input ) ( $rootScope ) ;
90
+ $rootScope . $digest ( ) ;
91
+ expect ( setterCalls ) . toBe ( 0 ) ;
92
+ } ) ) ;
93
+
75
94
describe ( 'compositionevents' , function ( ) {
76
95
it ( 'should not update the model between "compositionstart" and "compositionend" on non android' , function ( ) {
77
96
You can’t perform that action at this time.
0 commit comments