Skip to content

Commit 4a0e317

Browse files
committed
test(collectionRepeat): fix tests to add a timeout.flush()
1 parent 80a6e63 commit 4a0e317

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

js/angular/directive/collectionRepeat.js

-1
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,6 @@ function RepeatManagerFactory($rootScope, $window, $$rAF) {
500500

501501
this.destroy = function() {
502502
render.destroyed = true;
503-
unwatch();
504503

505504
itemsPool.forEach(function(item) {
506505
item.scope.$destroy();

test/unit/angular/directive/collectionRepeat.unit.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ describe('collectionRepeat', function() {
4747
}
4848

4949
var element;
50-
inject(function($compile, $rootScope) {
50+
inject(function($compile, $rootScope, $timeout) {
5151
repeaterScope = $rootScope.$new();
5252
attrs = attrs || '';
5353
if (!/item-height/.test(attrs)) attrs += ' item-height="25px"';
@@ -61,6 +61,7 @@ describe('collectionRepeat', function() {
6161
$compile(element)(repeaterScope);
6262
$rootScope.$apply();
6363
content.triggerHandler('scroll.init');
64+
$timeout.flush();
6465
$rootScope.$apply();
6566
});
6667
return element;

0 commit comments

Comments
 (0)