From: Robert Konigsberg <konigsberg@google.com>
Date: Thu, 27 Dec 2012 15:58:58 +0000 (-0500)
Subject: Add test for axisTickSize. Fill out test for yAxisLabelWidth. axisTickSize is no... 
X-Git-Tag: v1.0.0~138^2~5
X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=268e525d6a971cb7b1f22d0526fe43ae448c3a51;p=dygraphs.git

Add test for axisTickSize. Fill out test for yAxisLabelWidth. axisTickSize is no longer required for computeYAxes.
---

diff --git a/auto_tests/tests/to_dom_coords.js b/auto_tests/tests/to_dom_coords.js
index fb878ca..3def1ef 100644
--- a/auto_tests/tests/to_dom_coords.js
+++ b/auto_tests/tests/to_dom_coords.js
@@ -130,14 +130,38 @@ ToDomCoordsTestCase.prototype.testYAxisLabelWidth = function() {
     valueRange: [0, 100],
     dateWindow: [0, 100],
     width: 500,
-    height: 500,
+    height: 500
   }
 
   var graph = document.getElementById("graph");
   g = new Dygraph(graph, [ [0,0], [100,100] ], opts);
 
   assertEquals([100, 0], g.toDomCoords(0, 100));
+  assertEquals([500, 486], g.toDomCoords(100, 0));
 
   g.updateOptions({ yAxisLabelWidth: 50 });
   assertEquals([50, 0], g.toDomCoords(0, 100));
+  assertEquals([500, 486], g.toDomCoords(100, 0));
+}
+
+ToDomCoordsTestCase.prototype.testAxisTickSize = 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));
+  assertEquals([500, 486], g.toDomCoords(100, 0));
+
+  g.updateOptions({ axisTickSize : 50 });
+  assertEquals([200, 0], g.toDomCoords(0, 100));
+  assertEquals([500, 386], g.toDomCoords(100, 0));
 }
diff --git a/dygraph.js b/dygraph.js
index e5ec566..2bccd60 100644
--- a/dygraph.js
+++ b/dygraph.js
@@ -2460,7 +2460,6 @@ Dygraph.prototype.computeYAxes_ = function() {
     'valueRange',
     'pixelsPerYLabel',
     'axisLabelFontSize',
-    'axisTickSize'
   ];
 
   // Copy global axis options over to the first axis.