X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=auto_tests%2Ftests%2Fformats.js;h=f16cc6d8810cfa5390102a485c52cf4dfe2438be;hb=c4c10db644336a08b581e2efdb3ad75b950c905c;hp=36b36c9c7ff0d7203317067e2b6157f066d910bb;hpb=89fdcedbda6906d90e15d84285c4f6c0b8d96d28;p=dygraphs.git diff --git a/auto_tests/tests/formats.js b/auto_tests/tests/formats.js index 36b36c9..f16cc6d 100644 --- a/auto_tests/tests/formats.js +++ b/auto_tests/tests/formats.js @@ -3,14 +3,12 @@ * * @author konigsberg@google.com (Robert Konigsberg) */ -describe("formats", function() { -beforeEach(function() { - document.body.innerHTML = "
"; -}); +import Dygraph from '../../src/dygraph'; -afterEach(function() { -}); +describe("formats", function() { + +cleanupAfterEach(); var dataString = "X,Y\n" + @@ -24,6 +22,7 @@ var dataArray = [1,0], [2,1], [3,0]]; +var BASE_OPTS = {labels: ['X', 'Y']}; it('testCsv', function() { var data = dataString; @@ -35,18 +34,16 @@ it('testCsv', function() { it('testArray', function() { var data = dataArray; var graph = document.getElementById("graph"); - var g = new Dygraph(graph, data, {}); + var g = new Dygraph(graph, data, BASE_OPTS); assertData(g); }); it('testFunctionReturnsCsv', function() { - var string = dataString; - var data = function() { return string; }; + var data = function() { return dataString; }; var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, {}); - // assertData(g); - console.log("x"); + assertData(g); }); it('testFunctionDefinesArray', function() { @@ -54,7 +51,7 @@ it('testFunctionDefinesArray', function() { var data = function() { return array; } var graph = document.getElementById("graph"); - var g = new Dygraph(graph, data, {}); + var g = new Dygraph(graph, data, BASE_OPTS); assertData(g); });