]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - tests/qunit/suites/resources/jquery/jquery.color.test.js
MediaWiki 1.30.2
[autoinstallsdev/mediawiki.git] / tests / qunit / suites / resources / jquery / jquery.color.test.js
diff --git a/tests/qunit/suites/resources/jquery/jquery.color.test.js b/tests/qunit/suites/resources/jquery/jquery.color.test.js
new file mode 100644 (file)
index 0000000..ca6a512
--- /dev/null
@@ -0,0 +1,15 @@
+( function ( $ ) {
+       QUnit.module( 'jquery.color', QUnit.newMwEnvironment() );
+
+       QUnit.test( 'animate', function ( assert ) {
+               var done = assert.async(),
+                       $canvas = $( '<div>' ).css( 'background-color', '#fff' ).appendTo( '#qunit-fixture' );
+
+               $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 ) );