From: gnarf Date: Sun, 1 May 2011 11:23:19 +0000 (-0500) Subject: Unit Tests: Adding some basic unit tests for effects.* modules X-Git-Tag: 1.9m5~40^2~6 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ec5aeb1b154a023e2630d21aa7982ca13a00f03e;p=jquery-ui.git Unit Tests: Adding some basic unit tests for effects.* modules --- diff --git a/tests/unit/effects/effects.html b/tests/unit/effects/effects.html index 479fc3889..2cffda7ec 100644 --- a/tests/unit/effects/effects.html +++ b/tests/unit/effects/effects.html @@ -32,10 +32,9 @@ @@ -48,7 +47,8 @@
- + +
diff --git a/tests/unit/effects/effects_core.js b/tests/unit/effects/effects_core.js index bbd5e32a0..3da0b6f47 100644 --- a/tests/unit/effects/effects_core.js +++ b/tests/unit/effects/effects_core.js @@ -1,10 +1,28 @@ (function($) { -module( "effects - Core Effects" ); +var animateTime = 15; -test( "Empty Unit", function() { - expect( 1 ); - equals( 0, 0, "Unit Tests work" ); +module( "effects.core" ); + +$.each( $.effects.effect, function( effect ) { + if ( effect === "transfer" ) { + return; + } + QUnit.reset(); + module( "effect."+effect ); + test( "show/hide", function() { + var hidden = $( "div.hidden" ); + expect( 3 ); + stop(); + hidden.show( effect, animateTime, function() { + equal( hidden.css("display"), "block", "Hidden is shown after .show(\"" +effect+ "\", time)" ); + }).hide( effect, animateTime, function() { + equal( hidden.css("display"), "none", "Back to hidden after .hide(\"" +effect+ "\", time)" ); + }).queue( function(next) { + deepEqual( hidden.queue(), ["inprogress"], "Only the inprogress sentinel remains") + start(); + }); + }); }); })(jQuery);