X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=auto_tests%2Ftests%2Fscrolling_div.js;h=0a55c24cf5e9e3e9972f4b7e1cf576893048a4d7;hb=89fdcedbda6906d90e15d84285c4f6c0b8d96d28;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..0a55c24 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" + @@ -49,7 +49,7 @@ var LOREM_IPSUM = } ); -}; +}); // 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); +}); + +});