Skip to content
Permalink
Browse files

test(input): test for #12106

Add a test that checks that an <input> value is not set when the value is equal
to the current value

Closes #12592
  • Loading branch information
lgalfaso authored and petebacondarwin committed Aug 15, 2015
1 parent 6aa111b commit bd59335eba6fa2ca845daa7c90dd296cc7e6254d
Showing with 19 additions and 0 deletions.
  1. +19 −0 test/ng/directive/inputSpec.js
@@ -72,6 +72,25 @@ describe('input', function() {
expect($rootScope.form.$$renameControl).not.toHaveBeenCalled();
});


it('should not set the `val` property when the value is equal to the current value', inject(function($rootScope, $compile) {
// This is a workaround for Firefox validation. Look at #12102.
var input = jqLite('<input type="text" ng-model="foo" required/>');
var setterCalls = 0;
$rootScope.foo = '';
Object.defineProperty(input[0], 'value', {
get: function() {
return '';
},
set: function() {
setterCalls++;
}
});
$compile(input)($rootScope);
$rootScope.$digest();
expect(setterCalls).toBe(0);
}));

describe('compositionevents', function() {
it('should not update the model between "compositionstart" and "compositionend" on non android', function() {

0 comments on commit bd59335

Please sign in to comment.
You can’t perform that action at this time.