X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=auto_tests%2Ftests%2Fmissing_points.js;h=3c52dd08cfad18430ebd23e01c09ea312281f6df;hb=400a62b3df5b199814df17d57423f8c789d132de;hp=d8d1a72bf75627c681f60abf20c8d540754deacb;hpb=d8c77f390e5153637b471cc04f0ee4f557f4629e;p=dygraphs.git diff --git a/auto_tests/tests/missing_points.js b/auto_tests/tests/missing_points.js index d8d1a72..3c52dd0 100644 --- a/auto_tests/tests/missing_points.js +++ b/auto_tests/tests/missing_points.js @@ -239,6 +239,12 @@ MissingPointsTestCase.prototype.testCustomBarsWithMissingPoints = function() { [4, [4,5,6]], [5, [3,4,5]], [6, [null,null,null]], + [7, [2,3,4]], + [8, [1,2,3]], + [9, NaN], + [10, [2,3,4]], + [11, [3,4,5]], + [12, [NaN,NaN,NaN]] ]; var g = new Dygraph( document.getElementById("graph"), @@ -251,16 +257,23 @@ MissingPointsTestCase.prototype.testCustomBarsWithMissingPoints = function() { var htx = g.hidden_ctx_; - assertEquals(8, CanvasAssertions.numLinesDrawn(htx, '#ff0000')); + assertEquals(16, CanvasAssertions.numLinesDrawn(htx, '#ff0000')); var p0 = g.toDomCoords(data[0][0], data[0][1][1]); var p1 = g.toDomCoords(data[1][0], data[1][1][1]); - var p2 = g.toDomCoords(data[3][0], data[3][1][1]); - var p3 = g.toDomCoords(data[4][0], data[4][1][1]); - CanvasAssertions.assertConsecutiveLinesDrawn(htx, - [p0, p1], { strokeStyle: '#ff0000' }); - CanvasAssertions.assertConsecutiveLinesDrawn(htx, - [p2, p3], { strokeStyle: '#ff0000' }); + CanvasAssertions.assertLineDrawn(htx, p0, p1, { strokeStyle: '#ff0000' }); + + p0 = g.toDomCoords(data[3][0], data[3][1][1]); + p1 = g.toDomCoords(data[4][0], data[4][1][1]); + CanvasAssertions.assertLineDrawn(htx, p0, p1, { strokeStyle: '#ff0000' }); + + p0 = g.toDomCoords(data[6][0], data[6][1][1]); + p1 = g.toDomCoords(data[7][0], data[7][1][1]); + CanvasAssertions.assertLineDrawn(htx, p0, p1, { strokeStyle: '#ff0000' });; + + p0 = g.toDomCoords(data[9][0], data[9][1][1]); + p1 = g.toDomCoords(data[10][0], data[10][1][1]); + CanvasAssertions.assertLineDrawn(htx, p0, p1, { strokeStyle: '#ff0000' }); }; MissingPointsTestCase.prototype.testCustomBarsWithMissingPointsConnected = function() {