diff options
author | timmywil <tim.willison@thisismedium.com> | 2011-05-11 14:31:42 -0400 |
---|---|---|
committer | timmywil <tim.willison@thisismedium.com> | 2011-05-13 11:56:55 -0400 |
commit | 3486365062cdc7e8598cea238e67aafa33af7dce (patch) | |
tree | b534f651a70d6da87d01bb898a38d1ee0eee8ac2 /test | |
parent | 0f81cf89916262a3b5a0f85a33638edea562ca1f (diff) | |
download | jquery-3486365062cdc7e8598cea238e67aafa33af7dce.tar.gz jquery-3486365062cdc7e8598cea238e67aafa33af7dce.zip |
Animation callbacks keep their place in the queue stack. Fixes #9220.
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/queue.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/unit/queue.js b/test/unit/queue.js index 9b612ce37..c5c387a48 100644 --- a/test/unit/queue.js +++ b/test/unit/queue.js @@ -107,7 +107,31 @@ test("queue() passes in the next item in the queue as a parameter to fx queues", equals(counter, 2, "Deferreds resolved"); start(); }); +}); + +test("callbacks keep their place in the queue", function() { + expect(5); + stop(); + var div = jQuery("<div>"), + counter = 0; + + div.queue(function( next ) { + equal( ++counter, 1, "Queue/callback order: first called" ); + setTimeout( next, 200 ); + }).show(100, function() { + equal( ++counter, 2, "Queue/callback order: second called" ); + jQuery(this).hide(100, function() { + equal( ++counter, 4, "Queue/callback order: fourth called" ); + }); + }).queue(function( next ) { + equal( ++counter, 3, "Queue/callback order: third called" ); + next(); + }); + div.promise("fx").done(function() { + equals(counter, 4, "Deferreds resolved"); + start(); + }); }); test("delay()", function() { |