@@ -80,8 +80,10 @@ describe('$$animation', function() {
80
80
} ;
81
81
} ) ;
82
82
83
- inject ( function ( $$animation , $rootScope ) {
83
+ inject ( function ( $$animation , $rootScope , $rootElement ) {
84
84
element = jqLite ( '<div></div>' ) ;
85
+ $rootElement . append ( element ) ;
86
+
85
87
$$animation ( element , 'enter' ) ;
86
88
$rootScope . $digest ( ) ;
87
89
@@ -109,7 +111,8 @@ describe('$$animation', function() {
109
111
} ) ) ;
110
112
111
113
it ( "should obtain the element, event, the provided options and the domOperation" ,
112
- inject ( function ( $$animation , $rootScope ) {
114
+ inject ( function ( $$animation , $rootScope , $rootElement ) {
115
+ $rootElement . append ( element ) ;
113
116
114
117
var options = { } ;
115
118
options . foo = 'bar' ;
@@ -132,9 +135,11 @@ describe('$$animation', function() {
132
135
} ) ) ;
133
136
134
137
it ( "should obtain the classes string which is a combination of className, addClass and removeClass" ,
135
- inject ( function ( $$animation , $rootScope ) {
138
+ inject ( function ( $$animation , $rootScope , $rootElement ) {
136
139
137
140
element . addClass ( 'blue red' ) ;
141
+ $rootElement . append ( element ) ;
142
+
138
143
$$animation ( element , 'enter' , {
139
144
addClass : 'green' ,
140
145
removeClass : 'orange' ,
@@ -165,8 +170,9 @@ describe('$$animation', function() {
165
170
} ) ;
166
171
} ) ;
167
172
168
- inject ( function ( $$animation , $rootScope ) {
173
+ inject ( function ( $$animation , $rootScope , $rootElement ) {
169
174
element = jqLite ( '<div></div>' ) ;
175
+ $rootElement . append ( element ) ;
170
176
$$animation ( element , 'enter' ) ;
171
177
$rootScope . $digest ( ) ;
172
178
expect ( log ) . toEqual ( [ 'second' , 'first' ] ) ;
@@ -237,8 +243,10 @@ describe('$$animation', function() {
237
243
} ) ;
238
244
} ) ;
239
245
240
- inject ( function ( $$animation , $rootScope ) {
246
+ inject ( function ( $$animation , $rootScope , $rootElement ) {
241
247
element = jqLite ( '<div></div>' ) ;
248
+ $rootElement . append ( element ) ;
249
+
242
250
var runner = $$animation ( element , 'enter' ) ;
243
251
$rootScope . $digest ( ) ;
244
252
@@ -791,6 +799,8 @@ describe('$$animation', function() {
791
799
it ( 'should temporarily assign the provided CSS class for the duration of the animation' ,
792
800
inject ( function ( $rootScope , $$animation ) {
793
801
802
+ parent . append ( element ) ;
803
+
794
804
$$animation ( element , 'enter' , {
795
805
tempClasses : 'temporary fudge'
796
806
} ) ;
@@ -809,6 +819,8 @@ describe('$$animation', function() {
809
819
it ( 'should add and remove the ng-animate CSS class when the animation is active' ,
810
820
inject ( function ( $$animation , $rootScope ) {
811
821
822
+ parent . append ( element ) ;
823
+
812
824
$$animation ( element , 'enter' ) ;
813
825
$rootScope . $digest ( ) ;
814
826
expect ( element ) . toHaveClass ( 'ng-animate' ) ;
@@ -823,6 +835,8 @@ describe('$$animation', function() {
823
835
it ( 'should apply the `ng-animate` and temporary CSS classes before the driver is invoked' , function ( ) {
824
836
var capturedElementClasses ;
825
837
838
+ parent . append ( element ) ;
839
+
826
840
module ( function ( $provide ) {
827
841
$provide . factory ( 'mockedTestDriver' , function ( ) {
828
842
return function ( details ) {
@@ -832,6 +846,8 @@ describe('$$animation', function() {
832
846
} ) ;
833
847
834
848
inject ( function ( $$animation , $rootScope ) {
849
+ parent . append ( element ) ;
850
+
835
851
$$animation ( element , 'enter' , {
836
852
tempClasses : 'temp-class-name'
837
853
} ) ;
@@ -845,6 +861,8 @@ describe('$$animation', function() {
845
861
it ( 'should perform the DOM operation at the end of the animation if the driver doesn\'t run it already' ,
846
862
inject ( function ( $$animation , $rootScope ) {
847
863
864
+ parent . append ( element ) ;
865
+
848
866
var domOperationFired = false ;
849
867
$$animation ( element , 'enter' , {
850
868
domOperation : function ( ) {
0 commit comments