Add test case to verify that strings-as-divs are allowed.
[dygraphs.git] / auto_tests / tests / pathological_cases.js
1 /**
2 * @fileoverview Tests zero and one-point charts.
3 * These don't have to render nicely, they just have to not crash.
4 *
5 * @author dan@dygraphs.com (Dan Vanderkam)
6 */
7 var pathologicalCasesTestCase = TestCase("pathological-cases");
8
9 pathologicalCasesTestCase.prototype.setUp = function() {
10 document.body.innerHTML = "<div id='graph'></div>";
11 };
12
13 pathologicalCasesTestCase.prototype.tearDown = function() {
14 };
15
16 pathologicalCasesTestCase.prototype.testZeroPoint = function() {
17 var opts = {
18 width: 480,
19 height: 320
20 };
21 var data = "X,Y\n";
22
23 var graph = document.getElementById("graph");
24 var g = new Dygraph(graph, data, opts);
25 };
26
27 pathologicalCasesTestCase.prototype.testOnePoint = function() {
28 var opts = {
29 width: 480,
30 height: 320
31 };
32 var data = "X,Y\n" +
33 "1,2\n";
34
35 var graph = document.getElementById("graph");
36 var g = new Dygraph(graph, data, opts);
37 };
38
39 pathologicalCasesTestCase.prototype.testNullLegend = function() {
40 var opts = {
41 width: 480,
42 height: 320,
43 labelsDiv: null
44 };
45 var data = "X,Y\n" +
46 "1,2\n";
47
48 var graph = document.getElementById("graph");
49 var g = new Dygraph(graph, data, opts);
50 };
51
52 pathologicalCasesTestCase.prototype.testDivAsString = function() {
53 var data = "X,Y\n" +
54 "1,2\n";
55
56 var g = new Dygraph('graph', data, {});
57 }