X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=test%2Funit%2Fcss.js;h=649db5966b57b34526a57a03b4f660d66ed54f93;hb=8356871a5522ad59cac80af2ca4695079059b97e;hp=89f83982000aaca2f3753f4a9519a01e288961e7;hpb=4ae7234736fd501110a7bf2acea6cc68e24bd4cd;p=jquery.git diff --git a/test/unit/css.js b/test/unit/css.js index 89f8398..649db59 100644 --- a/test/unit/css.js +++ b/test/unit/css.js @@ -85,7 +85,7 @@ test("css(String, Function)", function() { try { expect(3); - var colors = ["#ff0000", "#00ff00", "#0000ff"]; + var sizes = ["10px", "20px", "30px"]; jQuery("
" + "
" + @@ -94,16 +94,18 @@ test("css(String, Function)", function() { var index = 0; - jQuery("#cssFunctionTest div").css("color", function() { - var color = colors[index]; + jQuery("#cssFunctionTest div").css("font-size", function() { + var size = sizes[index]; index++; - return color; + return size; }); index = 0; jQuery("#cssFunctionTest div").each(function() { - equals( jQuery(this).css("color"), colors[index], "Div #" + index + " should be " + colors[index] ); + var computedSize = jQuery(this).css("font-size") + var expectedSize = sizes[index] + equals( computedSize, expectedSize, "Div #" + index + " should be " + expectedSize ); index++; }); @@ -116,7 +118,7 @@ test("css(Object) where values are Functions", function() { try { expect(3); - var colors = ["#ff0000", "#00ff00", "#0000ff"]; + var sizes = ["10px", "20px", "30px"]; jQuery("
" + "
" + @@ -125,16 +127,18 @@ test("css(Object) where values are Functions", function() { var index = 0; - jQuery("#cssFunctionTest div").css({color: function() { - var color = colors[index]; + jQuery("#cssFunctionTest div").css({fontSize: function() { + var size = sizes[index]; index++; - return color; + return size; }}); index = 0; jQuery("#cssFunctionTest div").each(function() { - equals( jQuery(this).css("color"), colors[index], "Div #" + index + " should be " + colors[index] ); + var computedSize = jQuery(this).css("font-size") + var expectedSize = sizes[index] + equals( computedSize, expectedSize, "Div #" + index + " should be " + expectedSize ); index++; });