aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/data.js
diff options
context:
space:
mode:
authorYehuda Katz <wycats@gmail.com>2009-07-12 14:31:32 +0000
committerYehuda Katz <wycats@gmail.com>2009-07-12 14:31:32 +0000
commit89b4bc53ca0ca3d4e5c80b94ce92b09cc34af8ef (patch)
tree44844e8316629f520a1dd93603c058f4bfa93588 /test/unit/data.js
parent5b84c7c45c8c3c5e7c9a17239cd658b0c87ab892 (diff)
downloadjquery-89b4bc53ca0ca3d4e5c80b94ce92b09cc34af8ef.tar.gz
jquery-89b4bc53ca0ca3d4e5c80b94ce92b09cc34af8ef.zip
Added a next() shortcut for queues
Diffstat (limited to 'test/unit/data.js')
-rw-r--r--test/unit/data.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/unit/data.js b/test/unit/data.js
index fa56891fe..3389ef3d7 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();
})