X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=auto_tests%2Ftests%2Fscrolling_div.js;h=ce95a7ecd394e9c2d8bdc3f90e651983eb14bd32;hb=a4c3ece0a11e4e5c4f1f51a8bc8b7878d34ee052;hp=763504c2c7120b91c48c452164fa5df731bde7f1;hpb=319d0361d2e512ed8049dfedffd79254e491201c;p=dygraphs.git diff --git a/auto_tests/tests/scrolling_div.js b/auto_tests/tests/scrolling_div.js index 763504c..ce95a7e 100644 --- a/auto_tests/tests/scrolling_div.js +++ b/auto_tests/tests/scrolling_div.js @@ -3,11 +3,11 @@ * * @author konigsberg@google.com (Robert Konigsbrg) */ -var ScrollingDivTestCase = TestCase("scrolling-div"); +describe("scrolling-div", function() { var point, g; -ScrollingDivTestCase.prototype.setUp = function() { +beforeEach(function() { var LOREM_IPSUM = "

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod\n" + @@ -43,13 +43,13 @@ var LOREM_IPSUM = labels : ['a', 'b'], drawPoints : true, highlightCircleSize : 6, - pointClickCallback : function(evt, point) { - point = point; + pointClickCallback : function(evt, p) { + point = p; } } ); -}; +}); // This is usually something like 15, but for OS X Lion and its auto-hiding // scrollbars, it's 0. This is a large enough difference that we need to @@ -74,13 +74,13 @@ var detectScrollbarWidth = function() { return scrollbarWidth; }; -ScrollingDivTestCase.prototype.tearDown = function() { -}; +afterEach(function() { +}); /** * This tests that when the nested div is unscrolled, things work normally. */ -ScrollingDivTestCase.prototype.testUnscrolledDiv = function() { +it('testUnscrolledDiv', function() { document.getElementById('scroller').scrollTop = 0; @@ -95,14 +95,14 @@ ScrollingDivTestCase.prototype.testUnscrolledDiv = function() { DygraphOps.dispatchCanvasEvent(g, DygraphOps.createEvent(clickOn4_40, { type : 'mousedown' })); DygraphOps.dispatchCanvasEvent(g, DygraphOps.createEvent(clickOn4_40, { type : 'mouseup' })); - assertEquals(40, point.xval); - assertEquals(4, point.yval); -}; + assert.equal(40, point.xval); + assert.equal(4, point.yval); +}); /** * This tests that when the nested div is scrolled, things work normally. */ -ScrollingDivTestCase.prototype.testScrolledDiv = function() { +it('testScrolledDiv', function() { document.getElementById('scroller').scrollTop = 117; var clickOn4_40 = { @@ -116,6 +116,8 @@ ScrollingDivTestCase.prototype.testScrolledDiv = function() { DygraphOps.dispatchCanvasEvent(g, DygraphOps.createEvent(clickOn4_40, { type : 'mousedown' })); DygraphOps.dispatchCanvasEvent(g, DygraphOps.createEvent(clickOn4_40, { type : 'mouseup' })); - assertEquals(40, point.xval); - assertEquals(4, point.yval); -}; + assert.equal(40, point.xval); + assert.equal(4, point.yval); +}); + +});