Bug fix for dygraph point selection touch event.
[dygraphs.git] / auto_tests / tests / sanity.js
index 05c9b54..e1d37ab 100644 (file)
  *
  * @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 = "<div id='graph'></div>";
-});
+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);
   }
 });