From: Robert Konigsberg Date: Thu, 22 Nov 2012 17:20:54 +0000 (-0500) Subject: Add pathalogical test case (broken) that show that width and height are required... X-Git-Tag: v1.0.0~169^2~3 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=2c623e51b27d07159302a20161596bb50df4b19c;p=dygraphs.git Add pathalogical test case (broken) that show that width and height are required, which they should not, since dygraphs.com/options.html#width and http://dygraphs.com/options.html#height say that there are default values. --- diff --git a/auto_tests/tests/pathological_cases.js b/auto_tests/tests/pathological_cases.js index 21ff30a..9d24b99 100644 --- a/auto_tests/tests/pathological_cases.js +++ b/auto_tests/tests/pathological_cases.js @@ -48,3 +48,42 @@ pathologicalCasesTestCase.prototype.testNullLegend = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); }; + +pathologicalCasesTestCase.prototype.testNoWidth = function() { + var opts = { + height: 300, + }; + var data = "X,Y\n" + + "1,2\n"; + + var graph = document.getElementById("graph"); + var g = new Dygraph(graph, data, opts); + assertEquals(480, g.getOption("width")); + assertEquals(300, g.getOption("height")); +}; + + +pathologicalCasesTestCase.prototype.testNoHeight = function() { + var opts = { + width: 479, + }; + var data = "X,Y\n" + + "1,2\n"; + + var graph = document.getElementById("graph"); + var g = new Dygraph(graph, data, opts); + assertEquals(479, g.getOption("width")); + assertEquals(320, g.getOption("height")); +}; + +pathologicalCasesTestCase.prototype.testNoWidthOrHeight = function() { + var opts = { + }; + var data = "X,Y\n" + + "1,2\n"; + + var graph = document.getElementById("graph"); + var g = new Dygraph(graph, data, opts); + assertEquals(480, g.getOption("width")); + assertEquals(320, g.getOption("height")); +};