Label color is now specifiable per-axis. Also, I <3 jquery.
[dygraphs.git] / auto_tests / tests / Util.js
index 7fca030..66daa7f 100644 (file)
@@ -19,7 +19,7 @@ Util.getYLabels = function(axis_num, parent) {
     ary.push(y_labels[i].innerHTML);
   }
   return ary;
-}
+};
 
 /**
  * Get the x-labels for a given axis.
@@ -34,7 +34,7 @@ Util.getXLabels = function(parent) {
     ary.push(x_labels[i].innerHTML);
   }
   return ary;
-}
+};
 
 /**
  * Returns all text in tags w/ a given css class, sorted.
@@ -49,11 +49,20 @@ Util.getClassTexts = function(css_class, parent) {
   }
   texts.sort();
   return texts;
-}
+};
 
 Util.getLegend = function(parent) {
   parent = parent || document;
   var legend = parent.getElementsByClassName("dygraph-legend")[0];
   return legend.textContent;
-}
+};
 
+/**
+ * Assert that all elements have a certain style property.
+ */
+Util.assertStyleOfChildren = function(selector, property, expectedValue) {
+  assertTrue(selector.length > 0);
+  $.each(selector, function(idx, child) {
+    assertEquals(expectedValue,  $(child).css(property));
+  });
+};