X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fqunit%2Fsuites%2Fresources%2Fjquery%2Fjquery.color.test.js;h=d207260b7c53bb11fdf8b9dfa81033968e1dadf5;hb=add9bd191fd4d16250b301208600854cb52f6b33;hp=9afd793e5b2c249d3a8ded06dc3f79c250fb5418;hpb=04ebf62661d52b4b83098a97164b6624fb9aebdd;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/qunit/suites/resources/jquery/jquery.color.test.js b/tests/qunit/suites/resources/jquery/jquery.color.test.js index 9afd793e5b..d207260b7c 100644 --- a/tests/qunit/suites/resources/jquery/jquery.color.test.js +++ b/tests/qunit/suites/resources/jquery/jquery.color.test.js @@ -1,18 +1,15 @@ -( function ( $ ) { - QUnit.module( 'jquery.color', QUnit.newMwEnvironment( { - setup: function () { - this.clock = this.sandbox.useFakeTimers(); - } - } ) ); +( function () { + QUnit.module( 'jquery.color', QUnit.newMwEnvironment() ); - QUnit.test( 'animate', 1, function ( assert ) { - var $canvas = $( '
' ).css( 'background-color', '#fff' ); + QUnit.test( 'animate', function ( assert ) { + var done = assert.async(), + $canvas = $( '
' ).css( 'background-color', '#fff' ).appendTo( '#qunit-fixture' ); - $canvas.animate( { backgroundColor: '#000' }, 10 ).promise().then( function () { - var endColors = $.colorUtil.getRGB( $canvas.css( 'background-color' ) ); - assert.deepEqual( endColors, [ 0, 0, 0 ], 'end state' ); - } ); - - this.clock.tick( 20 ); + $canvas.animate( { 'background-color': '#000' }, 3 ).promise() + .done( function () { + var endColors = $.colorUtil.getRGB( $canvas.css( 'background-color' ) ); + assert.deepEqual( endColors, [ 0, 0, 0 ], 'end state' ); + } ) + .always( done ); } ); -}( jQuery ) ); +}() );