X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fdata.js;h=3389ef3d7a702524c198a139bf77d30cf1a4c41d;hb=89b4bc53ca0ca3d4e5c80b94ce92b09cc34af8ef;hp=fa56891fe4d0c3e9260134e17bbd5023455a9ac4;hpb=5b84c7c45c8c3c5e7c9a17239cd658b0c87ab892;p=jquery.git diff --git a/test/unit/data.js b/test/unit/data.js index fa56891..3389ef3 100644 --- a/test/unit/data.js +++ b/test/unit/data.js @@ -157,4 +157,25 @@ test("queue() with other types",function() { // Clean up $div.removeData(); +}); + +test("queue() passes in the next item in the queue as a parameter", function() { + expect(2); + + var div = jQuery({}); + var counter = 0; + + div.queue("foo", function(next) { + equals(++counter, 1, "Dequeueing"); + next(); + }).queue("foo", function(next) { + equals(++counter, 2, "Next was called"); + next(); + }).queue("bar", function() { + equals(++counter, 3, "Other queues are not triggered by next()") + }); + + div.dequeue("foo"); + + div.removeData(); })