diff options
author | Scott González <scott.gonzalez@gmail.com> | 2011-05-11 13:14:13 -0700 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2011-05-11 13:14:13 -0700 |
commit | 8b8f5bff7606701d883dc8e94469407e0c07483f (patch) | |
tree | f94efb183881b81fcf8edb5c362a77dde2726bc6 /tests | |
parent | 3eda502555d3ecd815b9ea2180510c1d2e0f8f2b (diff) | |
parent | 783f134aaa333b9e8795c701d8fd741de387cb0e (diff) | |
download | jquery-ui-8b8f5bff7606701d883dc8e94469407e0c07483f.tar.gz jquery-ui-8b8f5bff7606701d883dc8e94469407e0c07483f.zip |
Merge pull request #242 from gnarf37/effects-unit
Effects unit tests - Partial fix for #7353
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/effects/effects.html | 55 | ||||
-rw-r--r-- | tests/unit/effects/effects_core.js | 46 | ||||
-rw-r--r-- | tests/unit/index.html | 5 |
3 files changed, 106 insertions, 0 deletions
diff --git a/tests/unit/effects/effects.html b/tests/unit/effects/effects.html new file mode 100644 index 000000000..2cffda7ec --- /dev/null +++ b/tests/unit/effects/effects.html @@ -0,0 +1,55 @@ +<!doctype html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <title>jQuery UI Core Test Suite</title> + + <script src="../../../jquery-1.5.1.js"></script> + <script> + $.uiBackCompat = false; + </script> + <script src="../../../ui/jquery.effects.core.js"></script> + <script src="../../../ui/jquery.effects.blind.js"></script> + <script src="../../../ui/jquery.effects.bounce.js"></script> + <script src="../../../ui/jquery.effects.clip.js"></script> + <script src="../../../ui/jquery.effects.drop.js"></script> + <script src="../../../ui/jquery.effects.explode.js"></script> + <script src="../../../ui/jquery.effects.fade.js"></script> + <script src="../../../ui/jquery.effects.fold.js"></script> + <script src="../../../ui/jquery.effects.highlight.js"></script> + <script src="../../../ui/jquery.effects.pulsate.js"></script> + <script src="../../../ui/jquery.effects.scale.js"></script> + <script src="../../../ui/jquery.effects.shake.js"></script> + <script src="../../../ui/jquery.effects.slide.js"></script> + <script src="../../../ui/jquery.effects.transfer.js"></script> + + <link rel="stylesheet" href="../../../external/qunit.css"> + <script src="../../../external/qunit.js"></script> + <script src="../../jquery.simulate.js"></script> + <script src="../testsuite.js"></script> + <script src="effects_core.js"></script> + + <script src="../swarminject.js"></script> + + <style type="text/css"> + .hidden { + display: none; + } + </style> +</head> +<body> + +<h1 id="qunit-header">jQuery UI Effects Test Suite</h1> +<h2 id="qunit-banner"></h2> +<div id="qunit-testrunner-toolbar"></div> +<h2 id="qunit-userAgent"></h2> +<ol id="qunit-tests"> +</ol> + +<div id="qunit-fixture"> + <div class="hidden test"></div> + <div class="shown test"></div> +</div> + +</body> +</html> diff --git a/tests/unit/effects/effects_core.js b/tests/unit/effects/effects_core.js new file mode 100644 index 000000000..0359b73d3 --- /dev/null +++ b/tests/unit/effects/effects_core.js @@ -0,0 +1,46 @@ +(function($) { + +var animateTime = 15; + +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( 8 ); + stop(); + + var count = 0, + test = 0; + + function queueTest( fn ) { + count++; + var point = count; + return function( next ) { + test++; + equals( point, test, "Queue function fired in order" ); + if ( fn ) { + fn () + } else { + setTimeout( next, animateTime ); + } + } + } + + hidden.queue( queueTest() ).show( effect, animateTime, queueTest(function() { + equal( hidden.css("display"), "block", "Hidden is shown after .show(\"" +effect+ "\", time)" ); + })).queue( queueTest() ).hide( effect, animateTime, queueTest(function() { + equal( hidden.css("display"), "none", "Back to hidden after .hide(\"" +effect+ "\", time)" ); + })).queue( queueTest(function(next) { + deepEqual( hidden.queue(), ["inprogress"], "Only the inprogress sentinel remains") + start(); + })); + }); +}); + +})(jQuery); diff --git a/tests/unit/index.html b/tests/unit/index.html index a677023dc..5282d3f27 100644 --- a/tests/unit/index.html +++ b/tests/unit/index.html @@ -59,6 +59,11 @@ <li><a href="position/position.html">Position</a></li> </ul> +<h2>Effects</h2> +<ul> + <li><a href="effects/effects.html">Effects</a></li> +</ul> + </body> </html> |