Merge pull request #674 from danvk/module
[dygraphs.git] / auto_tests / tests / to_dom_coords.js
index 5aa4520..4540501 100644 (file)
@@ -3,20 +3,17 @@
  *
  * @author danvk@google.com (Dan Vanderkam)
  */
+import Dygraph from '../../src/dygraph';
+import * as utils from '../../src/dygraph-utils';
 
-describe("to-dom-coords", function() {
+import Proxy from './Proxy';
+import CanvasAssertions from './CanvasAssertions';
+import {assertDeepCloseTo} from './custom_asserts';
 
-var origFunc = Dygraph.getContext;
-beforeEach(function() {
-  document.body.innerHTML = "<div id='graph'></div>";
-  Dygraph.getContext = function(canvas) {
-    return new Proxy(origFunc(canvas));
-  }
-});
+describe("to-dom-coords", function() {
 
-afterEach(function() {
-  Dygraph.getContext = origFunc;
-});
+cleanupAfterEach();
+useProxyCanvas(utils, Proxy);
 
 // Checks that toDomCoords and toDataCoords are inverses of one another.
 var checkForInverses = function(g) {