mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
test(collectionRepeat): fix tests to add a timeout.flush()
This commit is contained in:
1
js/angular/directive/collectionRepeat.js
vendored
1
js/angular/directive/collectionRepeat.js
vendored
@@ -500,7 +500,6 @@ function RepeatManagerFactory($rootScope, $window, $$rAF) {
|
||||
|
||||
this.destroy = function() {
|
||||
render.destroyed = true;
|
||||
unwatch();
|
||||
|
||||
itemsPool.forEach(function(item) {
|
||||
item.scope.$destroy();
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user