Replace usage of the removed global reset() method with QUnit.reset().
[jquery.git] / test / unit / effects.js
index 2c5616d..919e3ea 100644 (file)
@@ -1,18 +1,36 @@
 module("effects");
 
 test("show()", function() {
-       expect(16);
+       expect(23);
        var pass = true, div = jQuery("#main div");
        div.show().each(function(){
                if ( this.style.display == "none" ) pass = false;
        });
        ok( pass, "Show" );
 
-       pass = true;
-       div.hide().show(null).each(function() {
-               if ( this.style.display == "none" ) pass = false;
+       var speeds = {
+         "null speed": null,
+         "undefined speed": undefined,
+         "empty string speed": "",
+         "false speed": false
+       };
+
+       jQuery.each(speeds, function(name, speed) {
+    pass = true;
+       div.hide().show(speed).each(function() {
+               if ( this.style.display == "none" ) pass = false;
+       });
+       ok( pass, "Show with " + name);
+  });
+
+
+       jQuery.each(speeds, function(name, speed) {
+    pass = true;
+       div.hide().show(speed, function() {
+                       pass = false;
+               });
+               ok( pass, "Show with " + name + " does not call animate callback" );
        });
-       ok( pass, "Show will null speed");
 
        jQuery("#main").append('<div id="show-tests"><div><p><a href="#"></a></p><code></code><pre></pre><span></span></div><table><thead><tr><th></th></tr></thead><tbody><tr><td></td></tr></tbody></table><ul><li></li></ul></div>');
 
@@ -43,7 +61,7 @@ test("show()", function() {
 
 test("show(Number) - other displays", function() {
        expect(15);
-       reset();
+       QUnit.reset();
        stop();
 
        jQuery("#main").append('<div id="show-tests"><div><p><a href="#"></a></p><code></code><pre></pre><span></span></div><table><thead><tr><th></th></tr></thead><tbody><tr><td></td></tr></tbody></table><ul><li></li></ul></div>');
@@ -120,7 +138,7 @@ test("animate option (queue === false)", function () {
 */
 
 test("animate with no properties", function() {
-       expect(1);
+       expect(2);
        
        var divs = jQuery("div"), count = 0;
 
@@ -129,6 +147,16 @@ test("animate with no properties", function() {
        });
 
        equals( divs.length, count, "Make sure that callback is called for each element in the set." );
+
+       stop();
+
+       var foo = jQuery("#foo");
+
+       foo.animate({});
+       foo.animate({top: 10}, 100, function(){
+               ok( true, "Animation was properly dequeued." );
+               start();
+       });
 });
 
 test("animate duration 0", function() {