Remove yAxisLabelWidth from Dygraph.axes_.
[dygraphs.git] / auto_tests / tests / to_dom_coords.js
index c70b704..fb878ca 100644 (file)
@@ -56,6 +56,7 @@ ToDomCoordsTestCase.prototype.testPlainChart = function() {
 
   this.checkForInverses(g);
 
+  // TODO(konigsberg): This doesn't really belong here. Move to its own test.
   var htx = g.hidden_ctx_;
   assertEquals(1, CanvasAssertions.numLinesDrawn(htx, '#ff0000'));
 }
@@ -120,3 +121,23 @@ ToDomCoordsTestCase.prototype.testChartWithAxesAndLabels = function() {
 
   this.checkForInverses(g);
 }
+
+ToDomCoordsTestCase.prototype.testYAxisLabelWidth = function() {
+  var opts = {
+    yAxisLabelWidth: 100,
+    axisTickSize: 0,
+    rightGap: 0,
+    valueRange: [0, 100],
+    dateWindow: [0, 100],
+    width: 500,
+    height: 500,
+  }
+
+  var graph = document.getElementById("graph");
+  g = new Dygraph(graph, [ [0,0], [100,100] ], opts);
+
+  assertEquals([100, 0], g.toDomCoords(0, 100));
+
+  g.updateOptions({ yAxisLabelWidth: 50 });
+  assertEquals([50, 0], g.toDomCoords(0, 100));
+}