X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=auto_tests%2Ftests%2Fno_hours.js;h=1fde9ef24f92d43bdf8b3210bb3ce562c66e62ce;hb=253f4333cfa17c5b6802fd574cb1a7c0b3a02603;hp=4f782d52bed79d185e659d95d5a7a996f1473aad;hpb=e26b71566419e1c051f3fbd1f4f8f64b063a04c9;p=dygraphs.git diff --git a/auto_tests/tests/no_hours.js b/auto_tests/tests/no_hours.js index 4f782d5..1fde9ef 100644 --- a/auto_tests/tests/no_hours.js +++ b/auto_tests/tests/no_hours.js @@ -14,11 +14,6 @@ noHoursTestCase.prototype.setUp = function() { noHoursTestCase.prototype.tearDown = function() { }; -function getLegend() { - var legend = document.getElementsByClassName("dygraph-legend")[0]; - return legend.textContent; -} - noHoursTestCase.prototype.testNoHours = function() { var opts = { width: 480, @@ -35,16 +30,16 @@ noHoursTestCase.prototype.testNoHours = function() { var g = new Dygraph(graph, data, opts); g.setSelection(0); - assertEquals("2012/03/13: Y:-1", getLegend()); + assertEquals("2012/03/13: Y: -1", Util.getLegend()); g.setSelection(1); - assertEquals("2012/03/14: Y:0", getLegend()); + assertEquals("2012/03/14: Y: 0", Util.getLegend()); g.setSelection(2); - assertEquals("2012/03/15: Y:1", getLegend()); + assertEquals("2012/03/15: Y: 1", Util.getLegend()); g.setSelection(3); - assertEquals("2012/03/16: Y:0", getLegend()); + assertEquals("2012/03/16: Y: 0", Util.getLegend()); }; noHoursTestCase.prototype.testNoHoursDashed = function() { @@ -63,15 +58,15 @@ noHoursTestCase.prototype.testNoHoursDashed = function() { var g = new Dygraph(graph, data, opts); g.setSelection(0); - assertEquals("2012/03/13: Y:-1", getLegend()); + assertEquals("2012/03/13: Y: -1", Util.getLegend()); g.setSelection(1); - assertEquals("2012/03/14: Y:0", getLegend()); + assertEquals("2012/03/14: Y: 0", Util.getLegend()); g.setSelection(2); - assertEquals("2012/03/15: Y:1", getLegend()); + assertEquals("2012/03/15: Y: 1", Util.getLegend()); g.setSelection(3); - assertEquals("2012/03/16: Y:0", getLegend()); + assertEquals("2012/03/16: Y: 0", Util.getLegend()); };