X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fqunit%2Fsuites%2Fresources%2Fjquery%2Fjquery.color.test.js;h=c8e8ac70e0d8ae915d145ec2aede1fc71b543b2f;hb=fe94275c8fcfc248a5eae857dde7c5772d993ab5;hp=839c5d5072fa94d307ae3f6fa3520fed807d6d77;hpb=3e39c2c157b30699b622d5cc4ae066a84ae74348;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 839c5d5072..d207260b7c 100644 --- a/tests/qunit/suites/resources/jquery/jquery.color.test.js +++ b/tests/qunit/suites/resources/jquery/jquery.color.test.js @@ -1,15 +1,15 @@ -( function ( $ ) { +( function () { QUnit.module( 'jquery.color', QUnit.newMwEnvironment() ); - QUnit.asyncTest( 'animate', 3, 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' }, 4 ).promise().then( function () { - var endColors = $.colorUtil.getRGB( $canvas.css( 'background-color' ) ); - assert.strictEqual( endColors[0], 0 ); - assert.strictEqual( endColors[1], 0 ); - assert.strictEqual( endColors[2], 0 ); - QUnit.start(); - } ); + $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 ) ); +}() );