aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorgnarf <gnarf@gnarf.net>2011-05-07 19:18:52 -0400
committertimmywil <tim.willison@thisismedium.com>2011-05-07 19:18:52 -0400
commit31268449b9255b21fad4bafd7da13c910a00af37 (patch)
tree89b75bd2b1e358a932b0cf6aa2b5bc1de4a24bc2 /test
parentc08556327032daa21493f2b3a77f2138352fadf8 (diff)
downloadjquery-31268449b9255b21fad4bafd7da13c910a00af37.tar.gz
jquery-31268449b9255b21fad4bafd7da13c910a00af37.zip
Landing pull request 372. Test for numeric properties was using wrong variable. Fixes #9074.
More Details: - https://github.com/jquery/jquery/pull/372
Diffstat (limited to 'test')
-rw-r--r--test/unit/effects.js34
1 files changed, 31 insertions, 3 deletions
diff --git a/test/unit/effects.js b/test/unit/effects.js
index d05182173..2a43c115b 100644
--- a/test/unit/effects.js
+++ b/test/unit/effects.js
@@ -32,7 +32,8 @@ test("show()", function() {
hiddendiv.css("display","");
- var pass = true, div = jQuery("#qunit-fixture div");
+ var pass = true;
+ div = jQuery("#qunit-fixture div");
div.show().each(function(){
if ( this.style.display == "none" ) pass = false;
});
@@ -582,7 +583,7 @@ jQuery.checkOverflowDisplay = function(){
equals(jQuery.css( this, "display" ), "inline", "Display shouldn't be tampered with.");
start();
-}
+};
test( "jQuery.fx.prototype.cur()", 6, function() {
var div = jQuery( "<div></div>" ).appendTo( "#qunit-fixture" ).css({
@@ -901,7 +902,7 @@ jQuery.makeTest = function( text ){
.after( elem );
return elem;
-}
+};
jQuery.makeTest.id = 1;
@@ -993,3 +994,30 @@ test("animate unit-less properties (#4966)", 2, function() {
start();
});
});
+
+test( "animate properties missing px w/ opacity as last (#9074)", 2, function() {
+ expect( 6 );
+ stop();
+ var div = jQuery( "<div style='position: absolute; margin-left: 0; left: 0px;'></div>" )
+ .appendTo( "#qunit-fixture" );
+ function cssInt( prop ) {
+ return parseInt( div.css( prop ), 10 );
+ }
+ equal( cssInt( "marginLeft" ), 0, "Margin left is 0" );
+ equal( cssInt( "left" ), 0, "Left is 0" );
+ div.animate({
+ left: 200,
+ marginLeft: 200,
+ opacity: 0
+ }, 1000);
+ setTimeout(function() {
+ var ml = cssInt( "marginLeft" ),
+ l = cssInt( "left" );
+ notEqual( ml, 0, "Margin left is not 0 after partial animate" );
+ notEqual( ml, 200, "Margin left is not 200 after partial animate" );
+ notEqual( l, 0, "Left is not 0 after partial animate" );
+ notEqual( l, 200, "Left is not 200 after partial animate" );
+ div.stop().remove();
+ start();
+ }, 100);
+});