summaryrefslogtreecommitdiff
path: root/tests/qunit/suites/resources/jquery/jquery.color.test.js
blob: c8e8ac70e0d8ae915d145ec2aede1fc71b543b2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
( function ( $ ) {
	QUnit.module( 'jquery.color', QUnit.newMwEnvironment( {
		setup: function () {
			this.clock = this.sandbox.useFakeTimers();
		}
	} ) );

	QUnit.test( 'animate', 1, function ( assert ) {
		var $canvas = $( '<div>' ).css( 'background-color', '#fff' );

		$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 );
	} );
}( jQuery ) );