Skip to content
Permalink
Browse files

Unit Tests: Adding some basic unit tests for effects.* modules

  • Loading branch information...
gnarf committed May 1, 2011
1 parent d82a44a commit ec5aeb1b154a023e2630d21aa7982ca13a00f03e
Showing with 27 additions and 9 deletions.
  1. +5 −5 tests/unit/effects/effects.html
  2. +22 −4 tests/unit/effects/effects_core.js
@@ -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 @@ <h2 id="qunit-userAgent"></h2>
</ol>

<div id="qunit-fixture">

<div class="hidden test"></div>
<div class="shown test"></div>
</div>

</body>
@@ -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);

0 comments on commit ec5aeb1

Please sign in to comment.
You can’t perform that action at this time.