diff options
-rw-r--r-- | jarmon/jarmon.test.js | 35 | ||||
-rw-r--r-- | test.html | 7 |
2 files changed, 41 insertions, 1 deletions
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 = $('<div><div class="chart"></div></div>').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({ @@ -7,7 +7,12 @@ href="http://developer.yahoo.com/yui/3/assets/yui.css"/> <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.1.1/build/cssfonts/fonts-min.css"/> - + <style type='text/css'> + .chart { + width: 500px; + height: 100px; + } + </style> <script src="http://yui.yahooapis.com/3.1.1/build/yui/yui-min.js"></script> <script src="docs/examples/assets/js/dependencies.js"></script> <script src="jarmon/jarmon.js"></script> |