X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=auto_tests%2Ftests%2Fhidpi.js;h=1dd131c7b48d1fedc5da453f4d04787eafd73b98;hb=401ff9f17c622f3173cc8d34cfcf3e444620d7d0;hp=c595065fb58d5b8064e9a6ca4459dad3a86afaa0;hpb=5fc893534031ff443e00b94325fdfc007274f99a;p=dygraphs.git diff --git a/auto_tests/tests/hidpi.js b/auto_tests/tests/hidpi.js index c595065..1dd131c 100644 --- a/auto_tests/tests/hidpi.js +++ b/auto_tests/tests/hidpi.js @@ -3,21 +3,24 @@ * * @author danvdk@gmail.com (Dan Vanderkam) */ -var hidpiTestCase = TestCase("hidpi"); + +import Dygraph from '../../src/dygraph'; + +describe("hidpi", function() { + +cleanupAfterEach(); var savePixelRatio; -hidpiTestCase.prototype.setUp = function() { +beforeEach(function() { savePixelRatio = window.devicePixelRatio; window.devicePixelRatio = 2; +}); - document.body.innerHTML = "
"; -}; - -hidpiTestCase.prototype.tearDown = function() { +afterEach(function() { window.devicePixelRatio = savePixelRatio; -}; +}); -hidpiTestCase.prototype.testDoesntCreateScrollbars = function() { +it('testDoesntCreateScrollbars', function() { var sw = document.body.scrollWidth; var cw = document.body.clientWidth; @@ -38,7 +41,9 @@ hidpiTestCase.prototype.testDoesntCreateScrollbars = function() { // Adding the graph shouldn't cause the width of the page to change. // (essentially, we're checking that we don't end up with a scrollbar) // See http://stackoverflow.com/a/2146905/388951 - assertEquals(cw, document.body.clientWidth); - assertEquals(sw, document.body.scrollWidth); -}; + assert.equal(cw, document.body.clientWidth); + assert.equal(sw, document.body.scrollWidth); +}); + +});