2 * @fileoverview Tests that we don'show specify hours, minutes or seconds
3 * in your dates if you don't specify them. This can get mixed up becaues of
6 * @author danvk@google.com (Dan Vanderkam)
8 var noHoursTestCase
= TestCase("no-hours");
10 noHoursTestCase
.prototype.setUp
= function() {
11 document
.body
.innerHTML
= "<div id='graph'></div>";
14 noHoursTestCase
.prototype.tearDown
= function() {
17 function getLegend() {
18 var legend
= document
.getElementsByClassName("dygraph-legend")[0];
19 return legend
.textContent
;
22 noHoursTestCase
.prototype.testNoHours
= function() {
27 var data
= "Date,Y\n" +
34 var graph
= document
.getElementById("graph");
35 var g
= new Dygraph(graph
, data
, opts
);
38 assertEquals("2012/03/13: Y:-1", getLegend());
41 assertEquals("2012/03/14: Y:0", getLegend());
44 assertEquals("2012/03/15: Y:1", getLegend());
47 assertEquals("2012/03/16: Y:0", getLegend());
50 noHoursTestCase
.prototype.testNoHoursDashed
= function() {
55 var data
= "Date,Y\n" +
62 var graph
= document
.getElementById("graph");
63 var g
= new Dygraph(graph
, data
, opts
);
66 assertEquals("2012/03/13: Y:-1", getLegend());
69 assertEquals("2012/03/14: Y:0", getLegend());
72 assertEquals("2012/03/15: Y:1", getLegend());
75 assertEquals("2012/03/16: Y:0", getLegend());