X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=auto_tests%2Ftests%2Fstacked.js;h=3d997af9491622762991f218bb4a02b48a986cdc;hb=514a10f302043e48459a79806775b6925dc9a7b5;hp=d3add124aa393b5d196c00faeffc405af65d2d25;hpb=3123ca57f71d145bb5bcc4a2f754d3dff3225346;p=dygraphs.git diff --git a/auto_tests/tests/stacked.js b/auto_tests/tests/stacked.js index d3add12..3d997af 100644 --- a/auto_tests/tests/stacked.js +++ b/auto_tests/tests/stacked.js @@ -3,20 +3,18 @@ * * @author dan@dygraphs.com (Dan Vanderkam) */ -describe("stacked", function() { -var _origGetContext = Dygraph.getContext; +import Dygraph from '../../src/dygraph'; +import * as utils from '../../src/dygraph-utils'; -beforeEach(function() { - document.body.innerHTML = "
"; - Dygraph.getContext = function(canvas) { - return new Proxy(_origGetContext(canvas)); - } -}); +import Proxy from './Proxy'; +import CanvasAssertions from './CanvasAssertions'; +import Util from './Util'; -afterEach(function() { - Dygraph.getContext = _origGetContext; -}); +describe("stacked", function() { + +cleanupAfterEach(); +useProxyCanvas(utils, Proxy); it('testCorrectColors', function() { var opts = { @@ -180,7 +178,8 @@ it('testMissingValueAtZero', function() { it('testInterpolation', function() { var opts = { colors: ['#ff0000', '#00ff00', '#0000ff'], - stackedGraph: true + stackedGraph: true, + labels: ['X', 'Y1', 'Y2', 'Y3', 'Y4'] }; // The last series is all-NaN, it ought to be treated as all zero @@ -236,7 +235,8 @@ it('testInterpolation', function() { it('testInterpolationOptions', function() { var opts = { colors: ['#ff0000', '#00ff00', '#0000ff'], - stackedGraph: true + stackedGraph: true, + labels: ['X', 'Y1', 'Y2', 'Y3'] }; var data = [ @@ -277,19 +277,20 @@ it('testMultiAxisInterpolation', function() { colors: ['#ff0000', '#00ff00', '#0000ff'], stackedGraph: true, series: { - "Y1": { - axis: 'y', - }, - "Y2": { - axis: 'y', - }, - "Y3": { - axis: 'y2', - }, - "Y4": { - axis: 'y2', - } - } + 'Y1': { + axis: 'y', + }, + 'Y2': { + axis: 'y', + }, + 'Y3': { + axis: 'y2', + }, + 'Y4': { + axis: 'y2', + } + }, + labels: ['X', 'Y1', 'Y2', 'Y3', 'Y4'] }; // The last series is all-NaN, it ought to be treated as all zero