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

Commit 496a67c

Browse files
test(ngModel): remove jankiness test
It is no longer appropriate to test this here as $animate takes care of queueing up CSS class changes into a single update.
1 parent 7dcfe5e commit 496a67c

File tree

1 file changed

+0
-40
lines changed

1 file changed

+0
-40
lines changed

test/ng/directive/ngModelSpec.js

-40
Original file line numberDiff line numberDiff line change
@@ -1182,46 +1182,6 @@ describe('ngModel', function() {
11821182
}));
11831183

11841184

1185-
it('should minimize janky setting of classes during $validate() and ngModelWatch', inject(function($animate, $compile, $rootScope) {
1186-
var addClass = $animate.addClass;
1187-
var removeClass = $animate.removeClass;
1188-
var addClassCallCount = 0;
1189-
var removeClassCallCount = 0;
1190-
var input;
1191-
$animate.addClass = function(element, className) {
1192-
if (input && element[0] === input[0]) ++addClassCallCount;
1193-
return addClass.call($animate, element, className);
1194-
};
1195-
1196-
$animate.removeClass = function(element, className) {
1197-
if (input && element[0] === input[0]) ++removeClassCallCount;
1198-
return removeClass.call($animate, element, className);
1199-
};
1200-
1201-
dealoc(element);
1202-
1203-
$rootScope.value = "123456789";
1204-
element = $compile(
1205-
'<form name="form">' +
1206-
'<input type="text" ng-model="value" name="alias" ng-maxlength="10">' +
1207-
'</form>'
1208-
)($rootScope);
1209-
1210-
var form = $rootScope.form;
1211-
input = element.children().eq(0);
1212-
1213-
$rootScope.$digest();
1214-
1215-
expect(input).toBeValid();
1216-
expect(input).not.toHaveClass('ng-invalid-maxlength');
1217-
expect(input).toHaveClass('ng-valid-maxlength');
1218-
expect(addClassCallCount).toBe(1);
1219-
expect(removeClassCallCount).toBe(0);
1220-
1221-
dealoc(element);
1222-
}));
1223-
1224-
12251185
it('should always use the most recent $viewValue for validation', function() {
12261186
ctrl.$parsers.push(function(value) {
12271187
if (value && value.substr(-1) === 'b') {

0 commit comments

Comments
 (0)