Fix Issue 60: Add tests for one data point and zero data points
[dygraphs.git] / auto_tests / tests / pathological_cases.js
CommitLineData
395e98a3
DV
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 */
7var pathologicalCasesTestCase = TestCase("pathological-cases");
8
9pathologicalCasesTestCase.prototype.setUp = function() {
10 document.body.innerHTML = "<div id='graph'></div>";
11};
12
13pathologicalCasesTestCase.prototype.tearDown = function() {
14};
15
16pathologicalCasesTestCase.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
27pathologicalCasesTestCase.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};