DygraphOps.dispatchMouseOut_Point(g, 800, 800); // This call should not throw an exception.
- assert.isFalse("exception thrown during mouseout", failed);
+ assert.isFalse(failed, "exception thrown during mouseout");
});
/**
* Test that the correct idx is returned for the point in the onHiglightCallback.
- */
+ */
it('testDrawHighlightPointCallback_idx', function() {
var idxToCheck = null;
};
var testdata = [[1, 2], [2, 3], [3, NaN], [4, 2], [5, NaN], [6, 3]];
var graph = document.getElementById("graph");
- var g = new Dygraph(graph, testdata,
- {
- drawHighlightPointCallback : drawHighlightPointCallback
+ var g = new Dygraph(graph, testdata, {
+ drawHighlightPointCallback: drawHighlightPointCallback,
+ labels: ['X', 'Y']
});
assert.isNull(idxToCheck);
assert.equal(5,idxToCheck);
});
+/**
+ * Test that drawCallback is called with the correct value for `this`.
+ */
+it('should set this in drawCallback', function() {
+ var g = new Dygraph('graph', data, {
+ drawCallback: function(g, is_initial) {
+ assert.isTrue(is_initial);
+ assert.equal(g, this);
+ }
+ });
+});
+
});