dygraph-utils.js compiles under closure with no warnings or errors
[dygraphs.git] / auto_tests / tests / callback.js
index e2f425f..0e6b4fa 100644 (file)
@@ -152,11 +152,11 @@ CallbackTestCase.prototype.testDrawPointCallback_isolated = function() {
   assertEquals(13, xvalues[0]);
   assertEquals(15, xvalues[1]);
 
-  // Test that isolated points + gap points get drawn when drawGapPoints is set.
-  // This should add one point at the right edge of the segment at x=11, but not
-  // at the graph edge at x=10.
+  // Test that isolated points + gap points get drawn when
+  // drawGapEdgePoints is set.  This should add one point at the right
+  // edge of the segment at x=11, but not at the graph edge at x=10.
   xvalues = []; // Reset for new test
-  graphOpts.drawGapPoints = true;
+  graphOpts.drawGapEdgePoints = true;
   g = new Dygraph(graph, testdata, graphOpts);
   assertEquals(3, xvalues.length);
   assertEquals(11, xvalues[0]);
@@ -302,6 +302,27 @@ CallbackTestCase.prototype.testClosestPointCallbackCss2 = function() {
 }
 
 /**
+ * Closest-point highlighting with locked series.
+ */
+CallbackTestCase.prototype.testSetSelectionLocking = function() {
+  var g = runClosestTest(false, 2, 4);
+
+  // Default behavior, 'b' is closest
+  DygraphOps.dispatchMouseMove(g, 11, 4);
+  assertEquals('b', g.getHighlightSeries());
+
+  // Now lock selection to 'c'
+  g.setSelection(false, 'c', true);
+  DygraphOps.dispatchMouseMove(g, 11, 4);
+  assertEquals('c', g.getHighlightSeries());
+
+  // Unlock, should be back to 'b'
+  g.clearSelection();
+  DygraphOps.dispatchMouseMove(g, 11, 4);
+  assertEquals('b', g.getHighlightSeries());
+}
+
+/**
  * This tests that closest point searches work for data containing NaNs.
  *
  * It's intended to catch a regression where a NaN Y value confuses the