Rewrite tests to use ES6 modules.
[dygraphs.git] / auto_tests / tests / simple_drawing.js
index bda0e84..2ef84f3 100644 (file)
  * @author konigsberg@google.com (Robert Konigsberg)
  */
 
-describe("simple-drawing", function() {
+import Dygraph from '../../src/dygraph';
+import * as utils from '../../src/dygraph-utils';
 
-var ZERO_TO_FIFTY = 'X,Y\n10,0\n20,50';
+import CanvasAssertions from './CanvasAssertions';
+import Proxy from './Proxy';
+import PixelSampler from './PixelSampler';
 
-var _origFunc = Dygraph.getContext;
-beforeEach(function() {
-  document.body.innerHTML = "<div id='graph'></div>";
-  Dygraph.getContext = function(canvas) {
-    return new Proxy(_origFunc(canvas));
-  }
-});
+describe("simple-drawing", function() {
 
-afterEach(function() {
-  Dygraph.getContext = _origFunc;
-});
+cleanupAfterEach();
+useProxyCanvas(utils, Proxy);
+
+var ZERO_TO_FIFTY = 'X,Y\n10,0\n20,50';
 
 it('testDrawSimpleRangePlusOne', function() {
   var opts = {