mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Unit Tests: Adding some basic unit tests for effects.* modules
This commit is contained in:
parent
d82a44ab4b
commit
ec5aeb1b15
@ -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>
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user