1 module("queue", { teardown: moduleTeardown });
3 test("queue() with other types",function() {
10 .queue('foo',function(){
11 equals( ++counter, 1, "Dequeuing" );
12 jQuery.dequeue(this,'foo');
14 .queue('foo',function(){
15 equals( ++counter, 2, "Dequeuing" );
16 jQuery(this).dequeue('foo');
18 .queue('foo',function(){
19 equals( ++counter, 3, "Dequeuing" );
21 .queue('foo',function(){
22 equals( ++counter, 4, "Dequeuing" );
25 equals( $div.queue('foo').length, 4, "Testing queue length" );
29 equals( counter, 3, "Testing previous call to dequeue" );
30 equals( $div.queue('foo').length, 1, "Testing queue length" );
34 equals( counter, 4, "Testing previous call to dequeue" );
35 equals( $div.queue('foo').length, 0, "Testing queue length" );
38 test("queue(name) passes in the next item in the queue as a parameter", function() {
44 div.queue("foo", function(next) {
45 equals(++counter, 1, "Dequeueing");
47 }).queue("foo", function(next) {
48 equals(++counter, 2, "Next was called");
50 }).queue("bar", function() {
51 equals(++counter, 3, "Other queues are not triggered by next()")
57 test("queue(name) passes in the next item in the queue as a parameter", function() {
63 div.queue("foo", function(next) {
64 equals(++counter, 1, "Dequeueing");
66 }).queue("foo", function(next) {
67 equals(++counter, 2, "Next was called");
69 }).queue("bar", function() {
70 equals(++counter, 3, "Other queues are not triggered by next()")
76 test("queue() passes in the next item in the queue as a parameter to fx queues", function() {
83 div.queue(function(next) {
84 equals(++counter, 1, "Dequeueing");
86 setTimeout(function() { next() }, 500);
87 }).queue(function(next) {
88 equals(++counter, 2, "Next was called");
91 }).queue("bar", function() {
92 equals(++counter, 3, "Other queues are not triggered by next()")
97 test("delay()", function() {
101 var foo = jQuery({}), run = 0;
103 foo.delay(100).queue(function(){
105 ok( true, "The function was dequeued." );
109 equals( run, 0, "The delay delayed the next function from running." );
112 test("clearQueue(name) clears the queue", function() {
115 var div = jQuery({});
118 div.queue("foo", function(next) {
120 jQuery(this).clearQueue("foo");
122 }).queue("foo", function(next) {
128 equals(counter, 1, "the queue was cleared");
131 test("clearQueue() clears the fx queue", function() {
134 var div = jQuery({});
137 div.queue(function(next) {
140 setTimeout(function() { jQuery(self).clearQueue(); next(); }, 50);
141 }).queue(function(next) {
145 equals(counter, 1, "the queue was cleared");