diff options
Diffstat (limited to 'test/unit/effects.js')
-rw-r--r-- | test/unit/effects.js | 49 |
1 files changed, 29 insertions, 20 deletions
diff --git a/test/unit/effects.js b/test/unit/effects.js index 653db6431..0f5eaa415 100644 --- a/test/unit/effects.js +++ b/test/unit/effects.js @@ -649,35 +649,44 @@ QUnit.test( "stop()", function( assert ) { this.clock.tick( 100 ); } ); -QUnit.test( "stop() - several in queue", function( assert ) { - assert.expect( 5 ); +// In IE9 inside testswarm this test doesn't work properly +( function() { + var type = "test"; - var nw, $foo = jQuery( "#foo" ); + if ( QUnit.isSwarm && /msie 9\.0/i.test( window.navigator.userAgent ) ) { + type = "skip"; + } - // default duration is 400ms, so 800px ensures we aren't 0 or 1 after 1ms - $foo.hide().css( "width", 800 ); + QUnit[ type ]( "stop() - several in queue", function( assert ) { + assert.expect( 5 ); - $foo.animate( { "width": "show" }, 400, "linear" ); - $foo.animate( { "width": "hide" } ); - $foo.animate( { "width": "show" } ); + var nw, $foo = jQuery( "#foo" ); - this.clock.tick( 1 ); + // default duration is 400ms, so 800px ensures we aren't 0 or 1 after 1ms + $foo.hide().css( "width", 800 ); - jQuery.fx.tick(); - assert.equal( $foo.queue().length, 3, "3 in the queue" ); + $foo.animate( { "width": "show" }, 400, "linear" ); + $foo.animate( { "width": "hide" } ); + $foo.animate( { "width": "show" } ); - nw = $foo.css( "width" ); - assert.notEqual( parseFloat( nw ), 1, "An animation occurred " + nw ); - $foo.stop(); + this.clock.tick( 1 ); - assert.equal( $foo.queue().length, 2, "2 in the queue" ); - nw = $foo.css( "width" ); - assert.notEqual( parseFloat( nw ), 1, "Stop didn't reset the animation " + nw ); + jQuery.fx.tick(); + assert.equal( $foo.queue().length, 3, "3 in the queue" ); - $foo.stop( true ); + nw = $foo.css( "width" ); + assert.notEqual( parseFloat( nw ), 1, "An animation occurred " + nw ); + $foo.stop(); - assert.equal( $foo.queue().length, 0, "0 in the queue" ); -} ); + assert.equal( $foo.queue().length, 2, "2 in the queue" ); + nw = $foo.css( "width" ); + assert.notEqual( parseFloat( nw ), 1, "Stop didn't reset the animation " + nw ); + + $foo.stop( true ); + + assert.equal( $foo.queue().length, 0, "0 in the queue" ); + } ); +} )(); QUnit.test( "stop(clearQueue)", function( assert ) { assert.expect( 4 ); |