mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-29 13:25:40 +08:00
fix(ngAnimate): cut down on extra $timeout calls
This commit is contained in:
committed by
Misko Hevery
parent
d11a34a351
commit
4382df03fa
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user