X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=auto_tests%2Ftests%2Fpathological_cases.js;h=985241f230df1e1ab2bda9bff4d9344581e83de6;hb=d66c74ef29a8ad222e7203911af1b46b37f5bde1;hp=502c8fdb62c4c499928a7909e7551f4636879e89;hpb=fa460473ef9397759466361ff32de56a4f8fa956;p=dygraphs.git diff --git a/auto_tests/tests/pathological_cases.js b/auto_tests/tests/pathological_cases.js index 502c8fd..985241f 100644 --- a/auto_tests/tests/pathological_cases.js +++ b/auto_tests/tests/pathological_cases.js @@ -68,8 +68,8 @@ pathologicalCasesTestCase.prototype.testCombinations = function() { padded: { includeZero: true, drawAxesAtZero: true, - xRangePad: 0.02, - yRangePad: 0.04 + xRangePad: 2, + yRangePad: 4 } }; @@ -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()); +};