test(collectionRepeat): fix tests to add a timeout.flush()

This commit is contained in:
Andrew
2015-03-04 10:44:50 -07:00
parent 80a6e637c4
commit 4a0e317231
2 changed files with 2 additions and 2 deletions

View File

@@ -500,7 +500,6 @@ function RepeatManagerFactory($rootScope, $window, $$rAF) {
this.destroy = function() {
render.destroyed = true;
unwatch();
itemsPool.forEach(function(item) {
item.scope.$destroy();

View File

@@ -47,7 +47,7 @@ describe('collectionRepeat', function() {
}
var element;
inject(function($compile, $rootScope) {
inject(function($compile, $rootScope, $timeout) {
repeaterScope = $rootScope.$new();
attrs = attrs || '';
if (!/item-height/.test(attrs)) attrs += ' item-height="25px"';
@@ -61,6 +61,7 @@ describe('collectionRepeat', function() {
$compile(element)(repeaterScope);
$rootScope.$apply();
content.triggerHandler('scroll.init');
$timeout.flush();
$rootScope.$apply();
});
return element;