2012-03-03 12:06:40 -05:00
|
|
|
|
|
|
|
rectest.ColorTestCase = Class( 'ColorTestCase' )
|
|
|
|
.implement( rectest.TestCase )
|
|
|
|
.extend(
|
|
|
|
{
|
|
|
|
'private static _sets': [
|
|
|
|
[ 'red', 'blue', 'green', 'yellow' ],
|
|
|
|
[ 'white', 'orange', 'black' ],
|
|
|
|
[ 'purple', 'brown', 'gray' ]
|
|
|
|
],
|
|
|
|
|
2012-03-03 14:20:50 -05:00
|
|
|
/**
|
|
|
|
* Element to contain color
|
|
|
|
* @var {jQuery}
|
|
|
|
*/
|
|
|
|
'private _$color': null,
|
|
|
|
|
|
|
|
|
2012-03-03 12:06:40 -05:00
|
|
|
'public getSet': function( set_id )
|
|
|
|
{
|
|
|
|
return this.__self.$( '_sets' )[ 0 ];
|
|
|
|
},
|
|
|
|
|
2012-03-03 14:20:50 -05:00
|
|
|
'public initRender': function( $element )
|
|
|
|
{
|
|
|
|
$element.append( this._$color = $( '<div>' )
|
|
|
|
.addClass( 'color-display' )
|
|
|
|
);
|
|
|
|
},
|
|
|
|
|
2012-03-03 12:06:40 -05:00
|
|
|
'public render': function( id, $element )
|
|
|
|
{
|
2012-03-03 14:20:50 -05:00
|
|
|
this._$color.css( 'background-color', id );
|
2012-03-03 12:06:40 -05:00
|
|
|
}
|
|
|
|
} );
|
|
|
|
|
|
|
|
// TODO: move
|
|
|
|
rectest.cases.colors = {
|
|
|
|
title: 'Colors',
|
|
|
|
testCase: rectest.ColorTestCase
|
|
|
|
};
|