diff options
author | Scott González <scott.gonzalez@gmail.com> | 2012-04-19 09:39:21 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2012-04-19 09:39:21 -0400 |
commit | aa187f57d16aae5cf5181cd967a385439b09c2ce (patch) | |
tree | ae18d23dce8ad710f84b6733ea3f59fbd6dc4dbb /tests/unit/effects | |
parent | 4f19289c10e733a07cf60435c2e5df4ed2e23d37 (diff) | |
download | jquery-ui-aa187f57d16aae5cf5181cd967a385439b09c2ce.tar.gz jquery-ui-aa187f57d16aae5cf5181cd967a385439b09c2ce.zip |
Tests: Lint
Diffstat (limited to 'tests/unit/effects')
-rw-r--r-- | tests/unit/effects/effects_core.js | 17 | ||||
-rw-r--r-- | tests/unit/effects/effects_scale.js | 19 |
2 files changed, 17 insertions, 19 deletions
diff --git a/tests/unit/effects/effects_core.js b/tests/unit/effects/effects_core.js index aca4c4694..93c7da114 100644 --- a/tests/unit/effects/effects_core.js +++ b/tests/unit/effects/effects_core.js @@ -99,7 +99,7 @@ asyncTest( "animateClass clears style properties when stopped", function() { var test = $("div.animateClass"), style = test[0].style, orig = style.cssText; - + expect( 2 ); test.addClass( "testChangeBackground", duration ); @@ -113,17 +113,17 @@ asyncTest( "animateClass clears style properties when stopped", function() { asyncTest( "animateClass: css and class changes during animation are not lost (#7106)", function() { var test = $( "div.ticket7106" ); - // add a class and change a style property after starting an animated class - test.addClass( "animate", minDuration, animationComplete ) - .addClass( "testClass" ) - .height( 100 ); - // ensure the class stays and that the css property stays function animationComplete() { ok( test.hasClass( "testClass" ), "class change during animateClass was not lost" ); equal( test.height(), 100, "css change during animateClass was not lost" ); start(); } + + // add a class and change a style property after starting an animated class + test.addClass( "animate", minDuration, animationComplete ) + .addClass( "testClass" ) + .height( 100 ); }); @@ -133,10 +133,9 @@ $.each( $.effects.effect, function( effect ) { } module( "effect."+effect ); asyncTest( "show/hide", function() { - var hidden = $( "div.hidden" ); expect( 8 ); - - var count = 0, + var hidden = $( "div.hidden" ), + count = 0, test = 0; function queueTest( fn ) { diff --git a/tests/unit/effects/effects_scale.js b/tests/unit/effects/effects_scale.js index b9bb91c2e..df61d9e91 100644 --- a/tests/unit/effects/effects_scale.js +++ b/tests/unit/effects/effects_scale.js @@ -4,6 +4,11 @@ module( "effect.scale: Scale" ); function run( position, v, h, vo, ho ) { var desc = "End Position Correct: " + position + " (" + v + "," + h + ") - origin: (" + vo + "," + ho + ")"; asyncTest( desc, function() { + function complete() { + equal( parseInt( test.css( h ), 10 ), target[ h ], "Horizontal Position Correct " + desc ); + equal( parseInt( test.css( v ), 10 ), target[ v ], "Vertical Position Correct " + desc ); + start(); + } var test = $( ".testScale" ), css = { position: position @@ -21,22 +26,16 @@ function run( position, v, h, vo, ho ) { css[ h ] = 33; css[ v ] = 33; - target[ h ] = h === ho ? css[ h ] : ho == "center" ? css[ h ] - 35 : css[ h ] - 70; - target[ v ] = v === vo ? css[ v ] : vo == "middle" ? css[ v ] - 35 : css[ v ] - 70; - if ( relative && h == "right" ) { + target[ h ] = h === ho ? css[ h ] : ho === "center" ? css[ h ] - 35 : css[ h ] - 70; + target[ v ] = v === vo ? css[ v ] : vo === "middle" ? css[ v ] - 35 : css[ v ] - 70; + if ( relative && h === "right" ) { target[ h ] += 70; } - if ( relative && v == "bottom" ) { + if ( relative && v === "bottom" ) { target[ v ] += 70; } test.css( css ); test.effect( effect ); - - function complete() { - equal( parseInt( test.css( h ), 10 ), target[ h ], "Horizontal Position Correct " + desc ); - equal( parseInt( test.css( v ), 10 ), target[ v ], "Vertical Position Correct " + desc ); - start(); - } }); } |