X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=auto_tests%2Ftests%2Fno_hours.js;h=323c84e838a568003f1cf2e1f0d2f4c00f62baf3;hb=24f982449792c7ba2a56af0e1e428a0896702080;hp=4f782d52bed79d185e659d95d5a7a996f1473aad;hpb=3f675fe524eece31f39fb68601d2d2d7d5720941;p=dygraphs.git diff --git a/auto_tests/tests/no_hours.js b/auto_tests/tests/no_hours.js index 4f782d5..323c84e 100644 --- a/auto_tests/tests/no_hours.js +++ b/auto_tests/tests/no_hours.js @@ -5,21 +5,16 @@ * * @author danvk@google.com (Dan Vanderkam) */ -var noHoursTestCase = TestCase("no-hours"); +describe("no-hours", function() { -noHoursTestCase.prototype.setUp = function() { +beforeEach(function() { document.body.innerHTML = "
"; -}; +}); -noHoursTestCase.prototype.tearDown = function() { -}; +afterEach(function() { +}); -function getLegend() { - var legend = document.getElementsByClassName("dygraph-legend")[0]; - return legend.textContent; -} - -noHoursTestCase.prototype.testNoHours = function() { +it('testNoHours', function() { var opts = { width: 480, height: 320 @@ -35,19 +30,19 @@ noHoursTestCase.prototype.testNoHours = function() { var g = new Dygraph(graph, data, opts); g.setSelection(0); - assertEquals("2012/03/13: Y:-1", getLegend()); + assert.equal("2012/03/13: Y: -1", Util.getLegend()); g.setSelection(1); - assertEquals("2012/03/14: Y:0", getLegend()); + assert.equal("2012/03/14: Y: 0", Util.getLegend()); g.setSelection(2); - assertEquals("2012/03/15: Y:1", getLegend()); + assert.equal("2012/03/15: Y: 1", Util.getLegend()); g.setSelection(3); - assertEquals("2012/03/16: Y:0", getLegend()); -}; + assert.equal("2012/03/16: Y: 0", Util.getLegend()); +}); -noHoursTestCase.prototype.testNoHoursDashed = function() { +it('testNoHoursDashed', function() { var opts = { width: 480, height: 320 @@ -63,15 +58,17 @@ noHoursTestCase.prototype.testNoHoursDashed = function() { var g = new Dygraph(graph, data, opts); g.setSelection(0); - assertEquals("2012/03/13: Y:-1", getLegend()); + assert.equal("2012/03/13: Y: -1", Util.getLegend()); g.setSelection(1); - assertEquals("2012/03/14: Y:0", getLegend()); + assert.equal("2012/03/14: Y: 0", Util.getLegend()); g.setSelection(2); - assertEquals("2012/03/15: Y:1", getLegend()); + assert.equal("2012/03/15: Y: 1", Util.getLegend()); g.setSelection(3); - assertEquals("2012/03/16: Y:0", getLegend()); -}; + assert.equal("2012/03/16: Y: 0", Util.getLegend()); +}); + +});