X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=auto_tests%2Ftests%2Fto_dom_coords.js;h=fb878ca9e2960cb9b14d0151a552ede587b4d096;hb=efd5b117af64cfe0a47f48046a5001f63eb5ca44;hp=c70b704776fe0faaa6a867485dfe2dff75560ae4;hpb=063e83bad654d6b5afcc156f7a2a0be4b2ea8e94;p=dygraphs.git diff --git a/auto_tests/tests/to_dom_coords.js b/auto_tests/tests/to_dom_coords.js index c70b704..fb878ca 100644 --- a/auto_tests/tests/to_dom_coords.js +++ b/auto_tests/tests/to_dom_coords.js @@ -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)); +}