test range selector creation/deletion
authorDan Vanderkam <danvdk@gmail.com>
Sun, 29 Mar 2015 22:11:45 +0000 (18:11 -0400)
committerDan Vanderkam <danvdk@gmail.com>
Sun, 29 Mar 2015 23:00:11 +0000 (19:00 -0400)
auto_tests/tests/range_selector.js

index 933cacf..a8b9459 100644 (file)
@@ -183,8 +183,13 @@ it('testRangeSelectorEnablingAfterCreation', function() {
              ];
   var graph = document.getElementById("graph");
   var g = new Dygraph(graph, data, opts);
+  var initialChartHeight = g.getArea().h;
   g.updateOptions({showRangeSelector: true});
   assertGraphExistence(g, graph);
+  assert(g.getArea().h < initialChartHeight);  // range selector shown
+
+  g.updateOptions({showRangeSelector: false});
+  assert.equal(g.getArea().h, initialChartHeight);  // range selector hidden
 });
 
 // The animatedZooms option does not work with the range selector. Make sure it gets turned off.
@@ -389,7 +394,6 @@ it('testMiniPlotDrawn', function() {
   var origFunc = Dygraph.getContext;
   var miniHtx;
   Dygraph.getContext = function(canvas) {
-    console.log(canvas.className);
     if (canvas.className != 'dygraph-rangesel-bgcanvas') {
       return origFunc(canvas);
     }