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

Commit 7af19ee

Browse files
committed
test: another ngModel test
1 parent 004bf88 commit 7af19ee

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/ng/directive/inputSpec.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1480,6 +1480,16 @@ describe('input', function() {
14801480
expect(scope.form.$$renameControl).not.toHaveBeenCalled();
14811481
});
14821482

1483+
it('should not invoke viewChangeListeners before input is touched', function() {
1484+
scope.value = 1;
1485+
var change = scope.change = jasmine.createSpy('change');
1486+
var element = $compile('<div><div ng-repeat="i in [1]">' +
1487+
'<input type="text" ng-model="value" maxlength="1" ng-change="change()" />' +
1488+
'</div></div>')(scope);
1489+
scope.$digest();
1490+
expect(change).not.toHaveBeenCalled();
1491+
dealoc(element);
1492+
});
14831493

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

0 commit comments

Comments
 (0)