X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=auto_tests%2Ftests%2Frange_tests.js;h=051c1e33e3ec7406bea64587eeec6e4bfa8a9e3f;hb=575b2dcdd982fc2a79d829556fdbbb5c6f6b6b6e;hp=2b2e59a7266be78b01e2c3ce6cbaeafe73374850;hpb=fa460473ef9397759466361ff32de56a4f8fa956;p=dygraphs.git diff --git a/auto_tests/tests/range_tests.js b/auto_tests/tests/range_tests.js index 2b2e59a..051c1e3 100644 --- a/auto_tests/tests/range_tests.js +++ b/auto_tests/tests/range_tests.js @@ -228,45 +228,6 @@ RangeTestCase.prototype.testIncludeZeroPerAxis = function() { assertEquals([44, 116], g.yAxisRange(1)); } - -/** - * Verify that includeZero range is properly specified per axis with old axis options. - */ -RangeTestCase.prototype.testIncludeZeroPerAxisOld = function() { - var g = new Dygraph("graph", - 'X,A,B\n' + - '0,50,50\n' + - '50,110,110\n', - { - drawPoints: true, - pointSize: 5, - - A: { - pointSize: 10 - }, - B: { - axis: {} - }, - axes: { - 'y': { includeZero: true }, - 'y2': { includeZero: false } - } - }); - - assertEquals([0, 121], g.yAxisRange(0)); - assertEquals([44, 116], g.yAxisRange(1)); - - g.updateOptions({ - axes: { - 'y': { includeZero: false }, - 'y2': { includeZero: true } - } - }); - - assertEquals([44, 116], g.yAxisRange(0)); - assertEquals([0, 121], g.yAxisRange(1)); -} - /** * Verify that very large Y ranges don't break things. */ @@ -368,3 +329,38 @@ RangeTestCase.prototype.testLogscalePad = function() { [[-10, 10], [10, 10], [30, 1000]], [-10, 30], [5.01691, 1993.25801]); }; + +/** + * Verify scrolling all-zero region, traditional. + */ +RangeTestCase.prototype.testZeroScroll = function() { + g = new Dygraph( + document.getElementById("graph"), + "X,Y\n" + + "1,0\n" + + "8,0\n" + + "9,0.1\n", + { + drawAxesAtZero: true, + animatedZooms: true, + avoidMinZero: true + }); +}; + +/** + * Verify scrolling all-zero region, new-style. + */ +RangeTestCase.prototype.testZeroScroll2 = function() { + g = new Dygraph( + document.getElementById("graph"), + "X,Y\n" + + "1,0\n" + + "8,0\n" + + "9,0.1\n", + { + animatedZooms: true, + drawAxesAtZero: true, + xRangePad: 4, + yRangePad: 4 + }); +};