2 * @fileoverview Tests zero and one-point charts.
3 * These don't have to render nicely, they just have to not crash.
5 * @author dan@dygraphs.com (Dan Vanderkam)
7 var pathologicalCasesTestCase
= TestCase("pathological-cases");
9 pathologicalCasesTestCase
.prototype.setUp
= function() {
10 document
.body
.innerHTML
= "<div id='graph'></div>";
13 pathologicalCasesTestCase
.prototype.tearDown
= function() {
16 pathologicalCasesTestCase
.prototype.testZeroPoint
= function() {
23 var graph
= document
.getElementById("graph");
24 var g
= new Dygraph(graph
, data
, opts
);
27 pathologicalCasesTestCase
.prototype.testOnePoint
= function() {
35 var graph
= document
.getElementById("graph");
36 var g
= new Dygraph(graph
, data
, opts
);
39 pathologicalCasesTestCase
.prototype.testNullLegend
= function() {
48 var graph
= document
.getElementById("graph");
49 var g
= new Dygraph(graph
, data
, opts
);
52 pathologicalCasesTestCase
.prototype.testNoWidth
= function() {
59 var graph
= document
.getElementById("graph");
60 var g
= new Dygraph(graph
, data
, opts
);
61 assertEquals(480, g
.getOption("width"));
62 assertEquals(300, g
.getOption("height"));
66 pathologicalCasesTestCase
.prototype.testNoHeight
= function() {
73 var graph
= document
.getElementById("graph");
74 var g
= new Dygraph(graph
, data
, opts
);
75 assertEquals(479, g
.getOption("width"));
76 assertEquals(320, g
.getOption("height"));
79 pathologicalCasesTestCase
.prototype.testNoWidthOrHeight
= function() {
85 var graph
= document
.getElementById("graph");
86 var g
= new Dygraph(graph
, data
, opts
);
87 assertEquals(480, g
.getOption("width"));
88 assertEquals(320, g
.getOption("height"));