X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=auto_tests%2Ftests%2Fscrolling_div.js;fp=auto_tests%2Ftests%2Fscrolling_div.js;h=c9dec0c76ab10cace5de4e1535cbc8f2b5e29c76;hb=e8c70e4e0f4c124a2c68eb43d6ec4e781d1bf810;hp=ce95a7ecd394e9c2d8bdc3f90e651983eb14bd32;hpb=6ecc073934b76e5076f917112a24ff7094857730;p=dygraphs.git diff --git a/auto_tests/tests/scrolling_div.js b/auto_tests/tests/scrolling_div.js index ce95a7e..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, @@ -74,9 +84,6 @@ var detectScrollbarWidth = function() { return scrollbarWidth; }; -afterEach(function() { -}); - /** * This tests that when the nested div is unscrolled, things work normally. */