X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=auto_tests%2Ftests%2Fscrolling_div.js;h=c9dec0c76ab10cace5de4e1535cbc8f2b5e29c76;hb=f6e73ea983b61b50a6152c98a9945725eb45edb2;hp=0a55c24cf5e9e3e9972f4b7e1cf576893048a4d7;hpb=89fdcedbda6906d90e15d84285c4f6c0b8d96d28;p=dygraphs.git diff --git a/auto_tests/tests/scrolling_div.js b/auto_tests/tests/scrolling_div.js index 0a55c24..c9dec0c 100644 --- a/auto_tests/tests/scrolling_div.js +++ b/auto_tests/tests/scrolling_div.js @@ -3,6 +3,10 @@ * * @author konigsberg@google.com (Robert Konigsbrg) */ + +import Dygraph from '../../src/dygraph'; +import DygraphOps from './DygraphOps'; + describe("scrolling-div", function() { var point, g; @@ -18,13 +22,19 @@ var LOREM_IPSUM = "non proident, sunt in culpa qui officia deserunt mollit anim id est\n" + "laborum.

"; - document.body.innerHTML = + var testDiv = document.getElementById('graph'); + testDiv.innerHTML = "
" + - "
" + + "
" + "
" + LOREM_IPSUM + "
" + "
" + LOREM_IPSUM + "
" + "
"; + // The old test runner had an 8px margin on the body + // The Mocha test runner does not. We set it on the test div to keep the + // coordinates the same. + testDiv.style.margin = '8px'; + var data = [ [ 10, 1 ], [ 20, 3 ], @@ -35,7 +45,7 @@ var LOREM_IPSUM = [ 70, 4 ], [ 80, 6 ] ]; - var graph = document.getElementById("graph"); + var graph = document.getElementById("graph-inner"); point = null; g = new Dygraph(graph, data, @@ -43,8 +53,8 @@ var LOREM_IPSUM = labels : ['a', 'b'], drawPoints : true, highlightCircleSize : 6, - pointClickCallback : function(evt, point) { - point = point; + pointClickCallback : function(evt, p) { + point = p; } } ); @@ -74,9 +84,6 @@ var detectScrollbarWidth = function() { return scrollbarWidth; }; -afterEach(function() { -}); - /** * This tests that when the nested div is unscrolled, things work normally. */