2 * @fileoverview Test cases for the callbacks.
4 * @author uemit.seren@gmail.com (Ümit Seren)
7 var CallbackTestCase
= TestCase("callback");
9 CallbackTestCase
.prototype.setUp
= function() {
10 document
.body
.innerHTML
= "<div id='graph'></div>";
13 CallbackTestCase
.prototype.tearDown
= function() {
16 var data
= "X,a\,b,c\n" +
24 * This tests that when the function idxToRow_ returns the proper row and the onHiglightCallback
25 * is properly called when the first series is hidden (setVisibility = false)
28 CallbackTestCase
.prototype.testHighlightCallbackIsCalled
= function() {
32 var highlightCallback
= function(e
, x
, pts
, row
) {
39 var graph
= document
.getElementById("graph");
40 var g
= new Dygraph(graph
, data
,
44 visibility
: [false, true, true],
45 highlightCallback
: highlightCallback
,
48 DygraphOps
.dispatchMouseMove(g
, 13, 10);
50 //check correct row is returned
51 assertEquals(3, h_row
);
52 //check there are only two points (because first series is hidden)
53 assertEquals(2, h_pts
.length
);