X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;ds=sidebyside;f=auto_tests%2Ftests%2Fsanity.js;h=e1d37ab4465f75ea43fc4e85a91dbb24f9e4bcb8;hb=HEAD;hp=05c9b542791847815ff3d47626f0ef1def85af98;hpb=89fdcedbda6906d90e15d84285c4f6c0b8d96d28;p=dygraphs.git diff --git a/auto_tests/tests/sanity.js b/auto_tests/tests/sanity.js index 05c9b54..e1d37ab 100644 --- a/auto_tests/tests/sanity.js +++ b/auto_tests/tests/sanity.js @@ -24,14 +24,15 @@ * * @author konigsberg@google.com (Robert Konigsberg) */ -var DEAD_SIMPLE_DATA = [[ 10, 2100 ]]; -var ZERO_TO_FIFTY = [[ 10, 0 ] , [ 20, 50 ]]; + +import Dygraph from '../../src/dygraph'; describe("dygraphs-sanity", function() { -beforeEach(function() { - document.body.innerHTML = "
"; -}); +var DEAD_SIMPLE_DATA = 'X,Y\n10,2100'; +var ZERO_TO_FIFTY = 'X,Y\n10,0\n20,50'; + +cleanupAfterEach(); /** * The sanity test of sanity tests. @@ -99,7 +100,7 @@ it('testToDomYCoord', function() { assert.equal(0, g.toDomYCoord(50)); for (var x = 0; x <= 50; x++) { - assert.equalsDelta(50 - x, g.toDomYCoord(x), 0.00001); + assert.closeTo(50 - x, g.toDomYCoord(x), 0.00001); } g.updateOptions({valueRange: null, axes: {y: {valueRange: [0, 50]}}}); @@ -107,7 +108,7 @@ it('testToDomYCoord', function() { assert.equal(0, g.toDomYCoord(50)); for (var x = 0; x <= 50; x++) { - assert.equalsDelta(50 - x, g.toDomYCoord(x), 0.00001); + assert.closeTo(50 - x, g.toDomYCoord(x), 0.00001); } });