@@ -32,12 +32,6 @@ describe("ngAnimate", function() {
32
32
33
33
describe ( "enable / disable" , function ( ) {
34
34
35
- beforeEach ( function ( ) {
36
- module ( function ( $animateProvider , $provide ) {
37
- $provide . value ( '$window' , angular . mock . createMockWindow ( ) ) ;
38
- } ) ;
39
- } ) ;
40
-
41
35
it ( "should disable and enable the animations" , function ( ) {
42
36
var $animate , initialState = null ;
43
37
@@ -259,8 +253,8 @@ describe("ngAnimate", function() {
259
253
260
254
$animate . removeClass ( element , 'ng-hide' ) ;
261
255
if ( $sniffer . transitions ) {
262
- $timeout . flushNext ( 1 ) ;
263
256
$timeout . flushNext ( 0 ) ;
257
+ $timeout . flushNext ( 1 ) ;
264
258
}
265
259
$timeout . flushNext ( 0 ) ;
266
260
expect ( element . text ( ) ) . toBe ( 'memento' ) ;
@@ -510,7 +504,7 @@ describe("ngAnimate", function() {
510
504
} ) ) ;
511
505
512
506
it ( "should skip animations if disabled and run when enabled" ,
513
- inject ( function ( $animate , $rootScope , $compile , $sniffer ) {
507
+ inject ( function ( $animate , $rootScope , $compile , $sniffer , $timeout ) {
514
508
$animate . enabled ( false ) ;
515
509
var style = 'animation: some_animation 2s linear 0s 1 alternate;' +
516
510
vendorPrefix + 'animation: some_animation 2s linear 0s 1 alternate;'
@@ -519,6 +513,7 @@ describe("ngAnimate", function() {
519
513
element . addClass ( 'ng-hide' ) ;
520
514
expect ( element ) . toBeHidden ( ) ;
521
515
$animate . removeClass ( element , 'ng-hide' ) ;
516
+ $timeout . flush ( ) ;
522
517
expect ( element ) . toBeShown ( ) ;
523
518
} ) ) ;
524
519
@@ -563,9 +558,9 @@ describe("ngAnimate", function() {
563
558
element . addClass ( 'ng-hide' ) ;
564
559
expect ( element ) . toBeHidden ( ) ;
565
560
$animate . removeClass ( element , 'ng-hide' ) ;
566
- expect ( element ) . toBeShown ( ) ;
567
-
568
561
$timeout . flushNext ( 0 ) ;
562
+ $timeout . flushNext ( 0 ) ;
563
+ expect ( element ) . toBeShown ( ) ;
569
564
570
565
$animate . enabled ( true ) ;
571
566
@@ -591,6 +586,7 @@ describe("ngAnimate", function() {
591
586
$timeout . flushNext ( 1 ) ;
592
587
$timeout . flushNext ( 2000 ) ;
593
588
}
589
+ $timeout . flush ( ) ;
594
590
expect ( element ) . toBeShown ( ) ;
595
591
} ) ) ;
596
592
@@ -604,10 +600,10 @@ describe("ngAnimate", function() {
604
600
605
601
element . addClass ( 'ng-hide' ) ;
606
602
$animate . removeClass ( element , 'ng-hide' ) ;
603
+ $timeout . flushNext ( 0 ) ;
604
+ $timeout . flushNext ( 0 ) ;
607
605
expect ( element ) . toBeShown ( ) ;
608
606
609
- $timeout . flushNext ( 0 ) ; //callback which is called
610
-
611
607
$animate . enabled ( true ) ;
612
608
613
609
element . addClass ( 'ng-hide' ) ;
@@ -618,7 +614,7 @@ describe("ngAnimate", function() {
618
614
$timeout . flushNext ( 1 ) ;
619
615
$timeout . flushNext ( 3000 ) ;
620
616
}
621
- $timeout . flushNext ( 0 ) ;
617
+ $timeout . flush ( ) ;
622
618
expect ( element ) . toBeShown ( ) ;
623
619
} ) ) ;
624
620
0 commit comments