jquery event: fixes #4989. blur and focus events now bubble and can be handled using...
[jquery.git] / test / unit / css.js
index 9f84d86..649db59 100644 (file)
@@ -85,7 +85,7 @@ test("css(String, Function)", function() {
        try { 
                expect(3);
                
-               var colors = ["red", "green", "blue"];
+               var sizes = ["10px", "20px", "30px"];
        
                jQuery("<div id='cssFunctionTest'><div class='cssFunction'></div>" + 
                                         "<div class='cssFunction'></div>" + 
@@ -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 = ["red", "green", "blue"];
+               var sizes = ["10px", "20px", "30px"];
        
                jQuery("<div id='cssFunctionTest'><div class='cssFunction'></div>" + 
                                         "<div class='cssFunction'></div>" + 
@@ -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++;
                });