@@ -49,7 +49,7 @@ QUnit.test( "jQuery.Color({ red: 10, green: 20, blue: 30, alpha: 0.4 })", functi
4949} ) ;
5050
5151QUnit . test ( "jQuery.Color( element, \"color\" )" , function ( assert ) {
52- var $div = jQuery ( "<div>" ) . css ( "color" , "#fff" ) ;
52+ var $div = jQuery ( "<div>" ) . appendTo ( "body" ) . css ( "color" , "#fff" ) ;
5353 assert . expect ( 8 ) ;
5454 testParts ( jQuery . Color ( $div , "color" ) , {
5555 prefix : "jQuery(<div>): " ,
@@ -65,6 +65,7 @@ QUnit.test( "jQuery.Color( element, \"color\" )", function( assert ) {
6565 blue : 255 ,
6666 alpha : 1
6767 } , assert ) ;
68+ $div . remove ( ) ;
6869} ) ;
6970
7071parseTest ( jQuery . Color ( { red : 100 } ) , {
@@ -616,7 +617,7 @@ QUnit.test( "animated", function( assert ) {
616617 assert . expect ( 8 ) ;
617618
618619 var done = assert . async ( ) ,
619- el = jQuery ( "<div></div>" ) . css ( { color : "#000000" } ) ;
620+ el = jQuery ( "<div></div>" ) . appendTo ( "body" ) . css ( { color : "#000000" } ) ;
620621
621622 el . animate ( { color : "#ffffff" } , 1 , function ( ) {
622623 testParts ( jQuery . Color ( el , "color" ) , {
@@ -636,6 +637,7 @@ QUnit.test( "animated", function( assert ) {
636637 alpha : 1
637638 } , assert ) ;
638639
640+ el . remove ( ) ;
639641 done ( ) ;
640642 } ) ;
641643} ) ;
@@ -653,20 +655,20 @@ QUnit.test( "animated documentFragment", function( assert ) {
653655} ) ;
654656
655657QUnit . test ( "Setting CSS to empty string / inherit" , function ( assert ) {
656- var el = jQuery ( "<div></div>" ) . css ( { color : "#fff" } ) ;
658+ var el = jQuery ( "<div></div>" ) . appendTo ( "body" ) . css ( { color : "#fff" } ) ;
657659 assert . expect ( 2 ) ;
658660
659661 el . css ( "color" , "" ) ;
660662 assert . equal ( el [ 0 ] . style . color , "" , "CSS was set to empty string" ) ;
661663
662664 el . css ( "color" , "inherit" ) ;
663- assert . ok ( el [ 0 ] . style . color === "inherit" , "Setting CSS to inherit didn't throw error" ) ;
665+ assert . ok ( el [ 0 ] . style . color === "" || el [ 0 ] . style . color === " inherit", "Setting CSS to inherit didn't throw error" ) ;
664666} ) ;
665667
666668QUnit . test ( "Setting CSS to transparent" , function ( assert ) {
667669 assert . expect ( 1 ) ;
668670
669- var parentEl = jQuery ( "<div></div>" ) . css ( { backgroundColor : "blue" } ) ,
671+ var parentEl = jQuery ( "<div></div>" ) . appendTo ( "body" ) . css ( { backgroundColor : "blue" } ) ,
670672 el = jQuery ( "<div></div>" ) . appendTo ( parentEl ) ;
671673
672674 el . css ( "backgroundColor" , "transparent" ) ;
0 commit comments