From 401ff9f17c622f3173cc8d34cfcf3e444620d7d0 Mon Sep 17 00:00:00 2001 From: Marcus Lewis Date: Thu, 5 May 2016 12:55:17 -0700 Subject: [PATCH] Add unit test to detect the "unwanted draw point" --- auto_tests/tests/draw_gap_edge_points.js | 47 ++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 auto_tests/tests/draw_gap_edge_points.js 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); + }); +}); -- 2.7.4