From: Dan Vanderkam Date: Sat, 16 Feb 2013 20:07:41 +0000 (-0500) Subject: Regression test for issue 430: Incorrect rendering when all values are negative and... X-Git-Tag: v1.0.0~74 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=620546065a0ddf28d54c02460f54ce4449f70c53;p=dygraphs.git Regression test for issue 430: Incorrect rendering when all values are negative and the same --- diff --git a/auto_tests/tests/pathological_cases.js b/auto_tests/tests/pathological_cases.js index 08d4661..985241f 100644 --- a/auto_tests/tests/pathological_cases.js +++ b/auto_tests/tests/pathological_cases.js @@ -134,4 +134,28 @@ pathologicalCasesTestCase.prototype.testDivAsString = function() { "1,2\n"; var g = new Dygraph('graph', data, {}); -} +}; + + +pathologicalCasesTestCase.prototype.testConstantSeriesNegative = function() { + var data = "X,Y\n" + + "1,-1\n" + + "2,-1\n"; + + g = new Dygraph('graph', data, {}); + // This check could be loosened to + // g.yAxisRange()[0] < g.yAxisRange()[1] if it breaks in the future. + assertEquals([-1.1, -0.9], g.yAxisRange()); +}; + + +pathologicalCasesTestCase.prototype.testConstantSeriesNegativeIncludeZero = function() { + var data = "X,Y\n" + + "1,-1\n" + + "2,-1\n"; + + g = new Dygraph('graph', data, {includeZero: true}); + // This check could be loosened to + // g.yAxisRange()[0] < g.yAxisRange()[1] if it breaks in the future. + assertEquals([-1.1, 0], g.yAxisRange()); +};