1
1
module ( "queue" , { teardown : moduleTeardown } ) ;
2
2
3
- test ( "queue() with other types" , 12 , function ( ) {
3
+ test ( "queue() with other types" , 14 , function ( ) {
4
4
var counter = 0 ;
5
5
6
6
stop ( ) ;
@@ -45,6 +45,12 @@ test( "queue() with other types", 12, function() {
45
45
46
46
equal ( counter , 4 , "Testing previous call to dequeue" ) ;
47
47
equal ( $div . queue ( "foo" ) . length , 0 , "Testing queue length" ) ;
48
+
49
+ $div . dequeue ( "foo" ) ;
50
+
51
+ equal ( counter , 4 , "Testing previous call to dequeue" ) ;
52
+ equal ( $div . queue ( "foo" ) . length , 0 , "Testing queue length" ) ;
53
+
48
54
} ) ;
49
55
50
56
test ( "queue(name) passes in the next item in the queue as a parameter" , function ( ) {
@@ -206,8 +212,8 @@ asyncTest( "fn.promise( \"queue\" ) - called whenever last queue function is deq
206
212
} ) . queue ( "queue" , function ( next ) {
207
213
strictEqual ( test ++ , 2 , "step two" ) ;
208
214
setTimeout ( function ( ) {
209
- strictEqual ( test ++ , 4 , "step four" ) ;
210
215
next ( ) ;
216
+ strictEqual ( test ++ , 4 , "step four" ) ;
211
217
start ( ) ;
212
218
} , 10 ) ;
213
219
} ) . promise ( "queue" ) . done ( function ( ) {
@@ -217,6 +223,27 @@ asyncTest( "fn.promise( \"queue\" ) - called whenever last queue function is deq
217
223
foo . dequeue ( "queue" ) ;
218
224
} ) ;
219
225
226
+ asyncTest ( "fn.promise( \"queue\" ) - waits for animation to complete before resolving" , 2 , function ( ) {
227
+ var foo = jQuery ( "#foo" ) ,
228
+ test = 1 ;
229
+
230
+ foo . animate ( {
231
+ top : 100
232
+ } , {
233
+ duration : 1 ,
234
+ queue : "queue" ,
235
+ complete : function ( ) {
236
+ strictEqual ( test ++ , 1 , "step one" ) ;
237
+ }
238
+ } ) . dequeue ( "queue" ) ;
239
+
240
+ foo . promise ( "queue" ) . done ( function ( ) {
241
+ strictEqual ( test ++ , 2 , "step two" ) ;
242
+ start ( ) ;
243
+ } ) ;
244
+
245
+ } ) ;
246
+
220
247
test ( ".promise(obj)" , function ( ) {
221
248
expect ( 2 ) ;
222
249
0 commit comments