From: Marcus Lewis Date: Thu, 5 May 2016 19:55:17 +0000 (-0700) Subject: Add unit test to detect the "unwanted draw point" X-Git-Tag: v2.0.0~25^2 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=401ff9f17c622f3173cc8d34cfcf3e444620d7d0;p=dygraphs.git Add unit test to detect the "unwanted draw point" --- diff --git a/auto_tests/tests/draw_gap_edge_points.js b/auto_tests/tests/draw_gap_edge_points.js new file mode 100644 index 0000000..3d92b0f --- /dev/null +++ b/auto_tests/tests/draw_gap_edge_points.js @@ -0,0 +1,47 @@ +/** + * @fileoverview Test cases for the option "drawGapEdgePoints" + */ + +import Dygraph from '../../src/dygraph'; +import * as utils from '../../src/dygraph-utils'; + +describe("draw-gap-edge-points", function() { + + cleanupAfterEach(); + + it("shouldn't draw any points by default", function() { + var called = false; + var g = new Dygraph(document.getElementById("graph"), + [[0, 0], + [1, 1], + [2, 2], + [3, 3], + [4, 4], + [5, 5]], + {labels: ['a', 'b'], + drawGapEdgePoints: true, + drawPointCallback: function() { called = true; }}); + + assert.isFalse(called); + }); + + it("shouldn't draw any points by default (no axes)", function() { + var called = false; + var g = new Dygraph(document.getElementById("graph"), + [[0, 0], + [1, 1], + [2, 2], + [3, 3], + [4, 4], + [5, 5]], + {labels: ['a', 'b'], + drawGapEdgePoints: true, + drawPointCallback: function() { called = true; }, + axes: { + x: { drawAxis: false }, + y: { drawAxis: false } + }}); + + assert.isFalse(called); + }); +});