From 9c71054a0e3f6e0bb5b524ada9b9c73ca90c2913 Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Mon, 4 Oct 2010 00:27:06 +0100 Subject: A test case for the Chart class --- jarmon/jarmon.test.js | 35 +++++++++++++++++++++++++++++++++++ test.html | 7 ++++++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/jarmon/jarmon.test.js b/jarmon/jarmon.test.js index 0ff1840..9ae7531 100644 --- a/jarmon/jarmon.test.js +++ b/jarmon/jarmon.test.js @@ -276,6 +276,41 @@ YUI({ logInclude: { TestRunner: true } }).use('console', 'test', function(Y) { })); + Y.Test.Runner.add(new Y.Test.Case({ + name: "jarmon.Chart", + + XsetUp: function() { + this.d = new jarmon.downloadBinary('build/test.rrd') + .addCallback( + function(self, binary) { + return new RRDFile(binary); + }, this) + .addErrback( + function(ret) { + console.log(ret); + }); + }, + + test_draw: function () { + /** + * + **/ + var $tpl = $('
').appendTo($('body')); + var c = new jarmon.Chart($tpl, {xaxis: {mode: "time"}}); + //jarmon.Chart.BASE_OPTIONS + //c.options.xaxis.tzoffset = 0; + c.addData('speed', new jarmon.RrdQueryRemote('build/test.rrd', 'm/s'), true); + var d = c.setTimeRange(RRD_STARTTIME, RRD_ENDTIME); + d.addCallback( + function(self) { + self.resume(function() { + Y.Assert.areEqual(1, 1); + }); + }, this); + this.wait(); + }, + })); + //initialize the console var yconsole = new Y.Console({ diff --git a/test.html b/test.html index 6db4f55..e8508f6 100644 --- a/test.html +++ b/test.html @@ -7,7 +7,12 @@ href="http://developer.yahoo.com/yui/3/assets/yui.css"/> - + -- cgit v1.2.3