fix(ngAnimate): cut down on extra $timeout calls

This commit is contained in:
Matias Niemelä
2013-08-28 19:18:33 -04:00
committed by Misko Hevery
parent d11a34a351
commit 4382df03fa
5 changed files with 38 additions and 169 deletions

View File

@@ -628,32 +628,22 @@ describe('ngView animations', function() {
$rootScope.$digest();
$animate.flushNext('enter'); //ngView
$timeout.flush();
$animate.flushNext('enter'); //repeat 1
$animate.flushNext('enter'); //repeat 2
$timeout.flush();
expect(element.text()).toEqual('12');
$location.path('/bar');
$rootScope.$digest();
$animate.flushNext('leave'); //ngView old
$timeout.flush();
$animate.flushNext('enter'); //ngView new
$timeout.flush();
expect(n(element.text())).toEqual(''); //this is midway during the animation
$animate.flushNext('enter'); //ngRepeat 3
$animate.flushNext('enter'); //ngRepeat 4
$timeout.flush();
expect(element.text()).toEqual('34');
function n(text) {