X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=auto_tests%2Ftests%2Fstep_plot_per_series.js;h=805a65adc6cbe83e825326b4506062b84ee52035;hb=ac928d203b05de4a8d43ad89667347865e98bb7c;hp=f5db2be459a9e324f8a3db57cd1461b00f8fee74;hpb=319d0361d2e512ed8049dfedffd79254e491201c;p=dygraphs.git diff --git a/auto_tests/tests/step_plot_per_series.js b/auto_tests/tests/step_plot_per_series.js index f5db2be..805a65a 100644 --- a/auto_tests/tests/step_plot_per_series.js +++ b/auto_tests/tests/step_plot_per_series.js @@ -8,26 +8,19 @@ * * @author julian.eichstaedt@ch.sauter-bc.com (Fr. Sauter AG) */ -var StepTestCase = TestCase("step-plot-per-series"); -StepTestCase.prototype.setUp = function() { - document.body.innerHTML = "
"; -}; +import Dygraph from '../../src/dygraph'; +import * as utils from '../../src/dygraph-utils'; -origFunc = Dygraph.getContext; +import Proxy from './Proxy'; +import CanvasAssertions from './CanvasAssertions'; -StepTestCase.prototype.setUp = function() { - document.body.innerHTML = "
"; - Dygraph.getContext = function(canvas) { - return new Proxy(origFunc(canvas)); - }; -}; +describe("step-plot-per-series", function() { -StepTestCase.prototype.tearDown = function() { - Dygraph.getContext = origFunc; -}; +cleanupAfterEach(); +useProxyCanvas(utils, Proxy); -StepTestCase.prototype.testMixedModeStepAndLineFilled = function() { +it('testMixedModeStepAndLineFilled', function() { var opts = { width: 480, height: 320, @@ -63,7 +56,7 @@ StepTestCase.prototype.testMixedModeStepAndLineFilled = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - htx = g.hidden_ctx_; + var htx = g.hidden_ctx_; var attrs = {}; @@ -94,9 +87,9 @@ StepTestCase.prototype.testMixedModeStepAndLineFilled = function() { xy2 = g.toDomCoords(x2, y2); CanvasAssertions.assertLineDrawn(htx, xy1, xy2, attrs); } -}; +}); -StepTestCase.prototype.testMixedModeStepAndLineStackedAndFilled = function() { +it('testMixedModeStepAndLineStackedAndFilled', function() { var opts = { width: 480, height: 320, @@ -134,7 +127,7 @@ StepTestCase.prototype.testMixedModeStepAndLineStackedAndFilled = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - htx = g.hidden_ctx_; + var htx = g.hidden_ctx_; var attrs = {}; @@ -249,9 +242,9 @@ StepTestCase.prototype.testMixedModeStepAndLineStackedAndFilled = function() { // The last edge can not be tested via assertLineDrawn since it wasn't drawn as a line but via clossePath. // But a rectangle is completely tested with three of its four edges. } -}; +}); -StepTestCase.prototype.testMixedModeStepAndLineErrorBars = function() { +it('testMixedModeStepAndLineErrorBars', function() { var opts = { width: 480, height: 320, @@ -284,7 +277,7 @@ StepTestCase.prototype.testMixedModeStepAndLineErrorBars = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - htx = g.hidden_ctx_; + var htx = g.hidden_ctx_; var attrs = {}; @@ -348,9 +341,9 @@ StepTestCase.prototype.testMixedModeStepAndLineErrorBars = function() { CanvasAssertions.assertLineDrawn(htx, xy1, xy2, attrs); } -}; +}); -StepTestCase.prototype.testMixedModeStepAndLineCustomBars = function() { +it('testMixedModeStepAndLineCustomBars', function() { var opts = { width: 480, height: 320, @@ -382,7 +375,7 @@ StepTestCase.prototype.testMixedModeStepAndLineCustomBars = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - htx = g.hidden_ctx_; + var htx = g.hidden_ctx_; var attrs = {}; @@ -447,4 +440,6 @@ StepTestCase.prototype.testMixedModeStepAndLineCustomBars = function() { xy2 = g.toDomCoords(data[i + 1][0], data[i + 1][2][1]); CanvasAssertions.assertLineDrawn(htx, xy1, xy2, attrs); } -}; +}); + +});