aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgnarf <gnarf@gnarf.net>2011-05-01 06:23:19 -0500
committergnarf <gnarf@gnarf.net>2011-05-01 06:23:19 -0500
commitec5aeb1b154a023e2630d21aa7982ca13a00f03e (patch)
tree09cafa4d7ac520766d6d660fd56aa9d6a5dfa456
parentd82a44ab4bf50675a843ebf752fe1dbca3ef38df (diff)
downloadjquery-ui-ec5aeb1b154a023e2630d21aa7982ca13a00f03e.tar.gz
jquery-ui-ec5aeb1b154a023e2630d21aa7982ca13a00f03e.zip
Unit Tests: Adding some basic unit tests for effects.* modules
-rw-r--r--tests/unit/effects/effects.html10
-rw-r--r--tests/unit/effects/effects_core.js26
2 files changed, 27 insertions, 9 deletions
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 @@
<script src="../swarminject.js"></script>
<style type="text/css">
- /*
- Space intentionally left blank - eventually
- we will probably define some basic css here to test effects
- */
+ .hidden {
+ display: none;
+ }
</style>
</head>
<body>
@@ -48,7 +47,8 @@
</ol>
<div id="qunit-fixture">
-
+ <div class="hidden test"></div>
+ <div class="shown test"></div>
</div>
</body>
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);