X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=auto_tests%2Ftests%2Ffill_step_plot.js;h=64060169e082ed4c93670616444ab4f3bbb483db;hb=bf50de0db3094fc5155efc8aee14112df2545e42;hp=fb66ad0aac25cd4fa61211cad6dda773e4bf16a0;hpb=8c31c7db4c13940f8a6bbab254a72a7991ae82ee;p=dygraphs.git diff --git a/auto_tests/tests/fill_step_plot.js b/auto_tests/tests/fill_step_plot.js index fb66ad0..6406016 100644 --- a/auto_tests/tests/fill_step_plot.js +++ b/auto_tests/tests/fill_step_plot.js @@ -1,31 +1,30 @@ /** - * @fileoverview Test if you put give null values to dygraph with stepPlot + * @fileoverview Test if you give null values to dygraph with stepPlot * and fillGraph options enabled * * @author benoitboivin.pro@gmail.com (Benoit Boivin) */ -var fillStepPlotTestCase = TestCase("fill-step-plot"); +describe("fill-step-plot", function() { -fillStepPlotTestCase.prototype.setUp = function() { +beforeEach(function() { document.body.innerHTML = "
"; -}; +}); -fillStepPlotTestCase.origFunc = Dygraph.getContext; +var origFunc = Dygraph.getContext; -fillStepPlotTestCase.prototype.setUp = function() { +beforeEach(function() { document.body.innerHTML = "
"; Dygraph.getContext = function(canvas) { - return new Proxy(fillStepPlotTestCase.origFunc(canvas)); + return new Proxy(origFunc(canvas)); }; -}; +}); -fillStepPlotTestCase.prototype.tearDown = function() { - Dygraph.getContext = fillStepPlotTestCase.origFunc; -}; +afterEach(function() { + Dygraph.getContext = origFunc; +}); -fillStepPlotTestCase.prototype.testFillStepPlotNullValues = function() { - var attrs = {}; +it('testFillStepPlotNullValues', function() { var opts = { labels: ["x","y"], width: 480, @@ -46,7 +45,7 @@ fillStepPlotTestCase.prototype.testFillStepPlotNullValues = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - htx = g.hidden_ctx_; + var htx = g.hidden_ctx_; var x1 = data[3][0]; var y1 = data[2][1]; var x2 = data[3][0]; @@ -55,5 +54,7 @@ fillStepPlotTestCase.prototype.testFillStepPlotNullValues = function() { var xy2 = g.toDomCoords(x2, y2); // Check if a line is drawn between the previous y and the bottom of the chart - CanvasAssertions.assertLineDrawn(htx, xy1, xy2, attrs); -}; \ No newline at end of file + CanvasAssertions.assertLineDrawn(htx, xy1, xy2, {}); +}); + +});