Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

test(input): test for #12106 #12592

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions test/ng/directive/inputSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {

Expand Down