Skip to content

Commit

Permalink
test(collectionRepeat): fix tests to add a timeout.flush()
Browse files Browse the repository at this point in the history
  • Loading branch information
ajoslin committed Mar 4, 2015
1 parent 80a6e63 commit 4a0e317
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion js/angular/directive/collectionRepeat.js
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,6 @@ function RepeatManagerFactory($rootScope, $window, $$rAF) {

this.destroy = function() {
render.destroyed = true;
unwatch();

itemsPool.forEach(function(item) {
item.scope.$destroy();
Expand Down
3 changes: 2 additions & 1 deletion test/unit/angular/directive/collectionRepeat.unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"';
Expand All @@ -61,6 +61,7 @@ describe('collectionRepeat', function() {
$compile(element)(repeaterScope);
$rootScope.$apply();
content.triggerHandler('scroll.init');
$timeout.flush();
$rootScope.$apply();
});
return element;
Expand Down

0 comments on commit 4a0e317

Please sign in to comment.