From: Dan Vanderkam Date: Sat, 21 Mar 2015 21:43:27 +0000 (-0400) Subject: Convert tests from jstd to Mocha. X-Git-Tag: v2.0.0~67^2~8 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=89fdcedbda6906d90e15d84285c4f6c0b8d96d28;p=dygraphs.git Convert tests from jstd to Mocha. --- diff --git a/.jshintrc b/.jshintrc index b50bc1f..72e44f8 100644 --- a/.jshintrc +++ b/.jshintrc @@ -8,6 +8,7 @@ "latedef": true, "nonbsp": true, "undef": true, + "sub": true, "browser": true, "devel": true, diff --git a/auto_tests/.jshintrc b/auto_tests/.jshintrc new file mode 100644 index 0000000..46ac7f5 --- /dev/null +++ b/auto_tests/.jshintrc @@ -0,0 +1,22 @@ +{ + "extends": "../.jshintrc", + + "asi": true, + "mocha": true, + "strict": false, + + "laxbreak": true, + + "globals": { + "assert": true, + "Dygraph": true, + "DygraphOps": true, + "Util": true, + "CanvasAssertions": true, + "PixelSampler": true, + "smoothPlotter": true, + "$": true, + "DygraphCanvasRenderer": true, + "DygraphOptions": true + } +} diff --git a/auto_tests/karma.conf.js b/auto_tests/karma.conf.js index 2f152dc..bf9ec4a 100644 --- a/auto_tests/karma.conf.js +++ b/auto_tests/karma.conf.js @@ -3,7 +3,7 @@ module.exports = function (config) { basePath: '../', frameworks: ['mocha', 'chai', 'chai-as-promised', 'sinon-chai', 'chai-things', 'dirty-chai'], files: [ - 'auto_tests/**.js', + 'auto_tests/**/*.js', 'dist/dygraph-combined.dev.js', 'src/extras/smooth-plotter.js', ], diff --git a/auto_tests/tests/CanvasAssertions.js b/auto_tests/tests/CanvasAssertions.js index 97279cf..2b37ec5 100644 --- a/auto_tests/tests/CanvasAssertions.js +++ b/auto_tests/tests/CanvasAssertions.js @@ -115,8 +115,8 @@ CanvasAssertions.assertLineDrawn = function(proxy, p1, p2, predicate) { } return s + "}"; }; - fail("Can't find a line drawn between " + p1 + - " and " + p2 + " with attributes " + toString(predicate)); + throw "Can't find a line drawn between " + p1 + + " and " + p2 + " with attributes " + toString(predicate); }; /** diff --git a/auto_tests/tests/Util.js b/auto_tests/tests/Util.js index 305ed47..3436c15 100644 --- a/auto_tests/tests/Util.js +++ b/auto_tests/tests/Util.js @@ -62,9 +62,9 @@ Util.getLegend = function(parent) { * Assert that all elements have a certain style property. */ Util.assertStyleOfChildren = function(selector, property, expectedValue) { - assertTrue(selector.length > 0); + assert.isTrue(selector.length > 0); $.each(selector, function(idx, child) { - assertEquals(expectedValue, $(child).css(property)); + assert.isEqual(expectedValue, $(child).css(property)); }); }; @@ -121,7 +121,7 @@ Util.overrideXMLHttpRequest = function(data) { this.responseText = data; }; FakeXMLHttpRequest.restore = function() { - XMLHttpRequest = originalXMLHttpRequest; + window.XMLHttpRequest = originalXMLHttpRequest; }; FakeXMLHttpRequest.respond = function() { for (var i = 0; i < requests.length; i++) { @@ -129,7 +129,7 @@ Util.overrideXMLHttpRequest = function(data) { } FakeXMLHttpRequest.restore(); }; - XMLHttpRequest = FakeXMLHttpRequest; + window.XMLHttpRequest = FakeXMLHttpRequest; return FakeXMLHttpRequest; }; diff --git a/auto_tests/tests/annotations.js b/auto_tests/tests/annotations.js index d0a2f7f..3ea5e7c 100644 --- a/auto_tests/tests/annotations.js +++ b/auto_tests/tests/annotations.js @@ -3,16 +3,16 @@ * * @author danvk@google.com (Dan Vanderkam) */ -var AnnotationsTestCase = TestCase("annotations"); +describe("annotations", function() { -AnnotationsTestCase.prototype.setUp = function() { +beforeEach(function() { document.body.innerHTML = "
"; -}; +}); -AnnotationsTestCase.prototype.tearDown = function() { -}; +afterEach(function() { +}); -AnnotationsTestCase.prototype.testAnnotationsDrawn = function() { +it('testAnnotationsDrawn', function() { var opts = { width: 480, height: 320 @@ -43,23 +43,23 @@ AnnotationsTestCase.prototype.testAnnotationsDrawn = function() { } ]); - assertEquals(2, g.annotations().length); + assert.equal(2, g.annotations().length); var a1 = document.getElementsByClassName('ann1'); - assertEquals(1, a1.length); + assert.equal(1, a1.length); a1 = a1[0]; - assertEquals('A', a1.textContent); + assert.equal('A', a1.textContent); var a2 = document.getElementsByClassName('ann2'); - assertEquals(1, a2.length); + assert.equal(1, a2.length); a2 = a2[0]; - assertEquals('B', a2.textContent); -}; + assert.equal('B', a2.textContent); +}); // Some errors that should be flagged: // 1. Invalid series name (e.g. 'X' or 'non-existent') // 2. Passing a string as 'x' instead of a number (e.g. x: '1') -AnnotationsTestCase.prototype.testAnnotationsDontDisappearOnResize = function() { +it('testAnnotationsDontDisappearOnResize', function() { var opts = { }; var data = "X,Y\n" + @@ -82,23 +82,23 @@ AnnotationsTestCase.prototype.testAnnotationsDontDisappearOnResize = function() ]); // Check that it displays at all - assertEquals(1, g.annotations().length); + assert.equal(1, g.annotations().length); var a1 = document.getElementsByClassName('ann1'); - assertEquals(1, a1.length); + assert.equal(1, a1.length); a1 = a1[0]; - assertEquals('A', a1.textContent); + assert.equal('A', a1.textContent); // ... and that resizing doesn't kill it. g.resize(400, 300); - assertEquals(1, g.annotations().length); + assert.equal(1, g.annotations().length); var a1 = document.getElementsByClassName('ann1'); - assertEquals(1, a1.length); + assert.equal(1, a1.length); a1 = a1[0]; - assertEquals('A', a1.textContent); -}; + assert.equal('A', a1.textContent); +}); // Verify that annotations outside of the visible x-range are not shown. -AnnotationsTestCase.prototype.testAnnotationsOutOfRangeX = function() { +it('testAnnotationsOutOfRangeX', function() { var opts = { }; var data = "X,Y\n" + @@ -121,27 +121,27 @@ AnnotationsTestCase.prototype.testAnnotationsOutOfRangeX = function() { ]); // Check that it displays at all - assertEquals(1, g.annotations().length); + assert.equal(1, g.annotations().length); var a1 = document.getElementsByClassName('ann1'); - assertEquals(1, a1.length); + assert.equal(1, a1.length); a1 = a1[0]; - assertEquals('A', a1.textContent); + assert.equal('A', a1.textContent); // ... and that panning right removes the annotation. g.updateOptions({dateWindow: [2, 6]}); - assertEquals(1, g.annotations().length); + assert.equal(1, g.annotations().length); a1 = document.getElementsByClassName('ann1'); - assertEquals(0, a1.length); + assert.equal(0, a1.length); // ... and that panning left brings it back. g.updateOptions({dateWindow: [0, 4]}); - assertEquals(1, g.annotations().length); + assert.equal(1, g.annotations().length); a1 = document.getElementsByClassName('ann1'); - assertEquals(1, a1.length); -}; + assert.equal(1, a1.length); +}); // Verify that annotations outside of the visible y-range are not shown. -AnnotationsTestCase.prototype.testAnnotationsOutOfRangeY = function() { +it('testAnnotationsOutOfRangeY', function() { var opts = { }; var data = "X,Y\n" + @@ -165,18 +165,18 @@ AnnotationsTestCase.prototype.testAnnotationsOutOfRangeY = function() { // ... check that panning up removes the annotation. g.updateOptions({valueRange: [0.5, 2.5]}); - assertEquals(1, g.annotations().length); - a1 = document.getElementsByClassName('ann1'); - assertEquals(0, a1.length); + assert.equal(1, g.annotations().length); + var a1 = document.getElementsByClassName('ann1'); + assert.equal(0, a1.length); // ... and that panning down brings it back. g.updateOptions({valueRange: [-1, 1]}); - assertEquals(1, g.annotations().length); + assert.equal(1, g.annotations().length); a1 = document.getElementsByClassName('ann1'); - assertEquals(1, a1.length); -}; + assert.equal(1, a1.length); +}); -AnnotationsTestCase.prototype.testAnnotationsDrawnInDrawCallback = function() { +it('testAnnotationsDrawnInDrawCallback', function() { var data = "X,Y\n" + "0,-1\n" + "1,0\n" + @@ -203,13 +203,13 @@ AnnotationsTestCase.prototype.testAnnotationsDrawnInDrawCallback = function() { } }); - assertEquals([true, false], calls); -}; + assert.deepEqual([true, false], calls); +}); // Test that annotations on the same point are stacked. // Regression test for http://code.google.com/p/dygraphs/issues/detail?id=256 -AnnotationsTestCase.prototype.testAnnotationsStacked = function() { +it('testAnnotationsStacked', function() { var data = 'X,Y1,Y2\n' + '0,1,2\n' + '1,2,3\n'; @@ -235,15 +235,15 @@ AnnotationsTestCase.prototype.testAnnotationsStacked = function() { g.setAnnotations(annotations); var annEls = document.getElementsByClassName('dygraphDefaultAnnotation'); - assertEquals(2, annEls.length); + assert.equal(2, annEls.length); - assertEquals(annEls[0].offsetLeft, annEls[1].offsetLeft); + assert.equal(annEls[0].offsetLeft, annEls[1].offsetLeft); assert(annEls[1].offsetTop < annEls[0].offsetTop - 10); -}; +}); // Test the .ready() method, which is most often used with setAnnotations(). -AnnotationsTestCase.prototype.testReady = function() { +it('testReady', function() { var data = 'X,Y1,Y2\n' + '0,1,2\n' + '1,2,3\n'; @@ -258,15 +258,17 @@ AnnotationsTestCase.prototype.testReady = function() { var ready_calls = 0; g.ready(function() { ready_calls++; }); - assertEquals(0, ready_calls); + assert.equal(0, ready_calls); mockXhr.respond(); - assertEquals(1, ready_calls); + assert.equal(1, ready_calls); // Make sure that ready isn't called on redraws. g.updateOptions({}); - assertEquals(1, ready_calls); + assert.equal(1, ready_calls); // Or data changes. g.updateOptions({file: data}); - assertEquals(1, ready_calls); -}; + assert.equal(1, ready_calls); +}); + +}); diff --git a/auto_tests/tests/axis_labels-deprecated.js b/auto_tests/tests/axis_labels-deprecated.js index da747e5..08a5db2 100644 --- a/auto_tests/tests/axis_labels-deprecated.js +++ b/auto_tests/tests/axis_labels-deprecated.js @@ -4,16 +4,16 @@ * * @author dan@dygraphs.com (Dan Vanderkam) */ -var DeprecatedAxisLabelsTestCase = TestCase("axis-labels-deprecated"); +describe("axis-labels-deprecated", function() { -DeprecatedAxisLabelsTestCase.prototype.setUp = function() { +beforeEach(function() { document.body.innerHTML = "
"; -}; +}); -DeprecatedAxisLabelsTestCase.prototype.tearDown = function() { -}; +afterEach(function() { +}); -DeprecatedAxisLabelsTestCase.prototype.testDeprecatedDeprecatedXAxisTimeLabelFormatter = function() { +it('testDeprecatedDeprecatedXAxisTimeLabelFormatter', function() { var opts = { width: 480, height: 320 @@ -39,33 +39,33 @@ DeprecatedAxisLabelsTestCase.prototype.testDeprecatedDeprecatedXAxisTimeLabelFor } }); - assertEquals(["00:05:00","00:05:12","00:05:24","00:05:36","00:05:48"], Util.getXLabels()); + assert.deepEqual(["00:05:00","00:05:12","00:05:24","00:05:36","00:05:48"], Util.getXLabels()); // The legend does not use the xAxisLabelFormatter: g.setSelection(1); - assertEquals('5.1: Y1: 1', Util.getLegend()); -}; + assert.equal('5.1: Y1: 1', Util.getLegend()); +}); -DeprecatedAxisLabelsTestCase.prototype.testDeprecatedAxisLabelFormatter = function () { +it('testDeprecatedAxisLabelFormatter', function() { var opts = { width: 480, height: 320, axes : { x : { axisLabelFormatter: function(x, granularity, opts, dg) { - assertEquals('number', typeof(x)); - assertEquals('number', typeof(granularity)); - assertEquals('function', typeof(opts)); - assertEquals('[Dygraph graph]', dg.toString()); + assert.equal('number', typeof(x)); + assert.equal('number', typeof(granularity)); + assert.equal('function', typeof(opts)); + assert.equal('[Dygraph graph]', dg.toString()); return 'x' + x; } }, y : { axisLabelFormatter: function(y, granularity, opts, dg) { - assertEquals('number', typeof(y)); - assertEquals('number', typeof(granularity)); - assertEquals('function', typeof(opts)); - assertEquals('[Dygraph graph]', dg.toString()); + assert.equal('number', typeof(y)); + assert.equal('number', typeof(granularity)); + assert.equal('function', typeof(opts)); + assert.equal('[Dygraph graph]', dg.toString()); return 'y' + y; } } @@ -79,34 +79,34 @@ DeprecatedAxisLabelsTestCase.prototype.testDeprecatedAxisLabelFormatter = functi var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - assertEquals(['x0','x2','x4','x6','x8'], Util.getXLabels()); - assertEquals(["y0","y5","y10","y15"], Util.getYLabels()); + assert.deepEqual(['x0','x2','x4','x6','x8'], Util.getXLabels()); + assert.deepEqual(["y0","y5","y10","y15"], Util.getYLabels()); g.setSelection(2); - assertEquals("2: y: 4", Util.getLegend()); -}; + assert.equal("2: y: 4", Util.getLegend()); +}); -DeprecatedAxisLabelsTestCase.prototype.testDeprecatedDateAxisLabelFormatter = function () { +it('testDeprecatedDateAxisLabelFormatter', function() { var opts = { width: 480, height: 320, axes : { x : { axisLabelFormatter: function(x, granularity, opts, dg) { - assertTrue(Dygraph.isDateLike(x)); - assertEquals('number', typeof(granularity)); - assertEquals('function', typeof(opts)); - assertEquals('[Dygraph graph]', dg.toString()); + assert.isTrue(Dygraph.isDateLike(x)); + assert.equal('number', typeof(granularity)); + assert.equal('function', typeof(opts)); + assert.equal('[Dygraph graph]', dg.toString()); return 'x' + Util.formatDate(x); }, pixelsPerLabel: 60 }, y : { axisLabelFormatter: function(y, granularity, opts, dg) { - assertEquals('number', typeof(y)); - assertEquals('number', typeof(granularity)); - assertEquals('function', typeof(opts)); - assertEquals('[Dygraph graph]', dg.toString()); + assert.equal('number', typeof(y)); + assert.equal('number', typeof(granularity)); + assert.equal('function', typeof(opts)); + assert.equal('[Dygraph graph]', dg.toString()); return 'y' + y; } } @@ -120,36 +120,36 @@ DeprecatedAxisLabelsTestCase.prototype.testDeprecatedDateAxisLabelFormatter = fu var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - assertEquals(["x2011/01/02","x2011/01/04","x2011/01/06","x2011/01/08"], Util.getXLabels()); - assertEquals(["y5","y10","y15"], Util.getYLabels()); + assert.deepEqual(["x2011/01/02","x2011/01/04","x2011/01/06","x2011/01/08"], Util.getXLabels()); + assert.deepEqual(["y5","y10","y15"], Util.getYLabels()); g.setSelection(0); - assertEquals("2011/01/01: y: 2", Util.getLegend()); -}; + assert.equal("2011/01/01: y: 2", Util.getLegend()); +}); // This test verifies that when a valueFormatter is set (but not an // axisLabelFormatter), then the valueFormatter is used to format the axis // labels. -DeprecatedAxisLabelsTestCase.prototype.testDeprecatedValueFormatter = function () { +it('testDeprecatedValueFormatter', function() { var opts = { width: 480, height: 320, axes : { x : { valueFormatter: function(x, opts, series_name, dg) { - assertEquals('number', typeof(x)); - assertEquals('function', typeof(opts)); - assertEquals('string', typeof(series_name)); - assertEquals('[Dygraph graph]', dg.toString()); + assert.equal('number', typeof(x)); + assert.equal('function', typeof(opts)); + assert.equal('string', typeof(series_name)); + assert.equal('[Dygraph graph]', dg.toString()); return 'x' + x; } }, y : { valueFormatter: function(y, opts, series_name, dg) { - assertEquals('number', typeof(y)); - assertEquals('function', typeof(opts)); - assertEquals('string', typeof(series_name)); - assertEquals('[Dygraph graph]', dg.toString()); + assert.equal('number', typeof(y)); + assert.equal('function', typeof(opts)); + assert.equal('string', typeof(series_name)); + assert.equal('[Dygraph graph]', dg.toString()); return 'y' + y; } } @@ -164,35 +164,35 @@ DeprecatedAxisLabelsTestCase.prototype.testDeprecatedValueFormatter = function ( var g = new Dygraph(graph, data, opts); // the valueFormatter options do not affect the ticks. - assertEquals(['0','2','4','6','8'], Util.getXLabels()); - assertEquals(["0","5","10","15"], Util.getYLabels()); + assert.deepEqual(['0','2','4','6','8'], Util.getXLabels()); + assert.deepEqual(["0","5","10","15"], Util.getYLabels()); // they do affect the legend, however. g.setSelection(2); - assertEquals("x2: y: y4", Util.getLegend()); -}; + assert.equal("x2: y: y4", Util.getLegend()); +}); -DeprecatedAxisLabelsTestCase.prototype.testDeprecatedDateValueFormatter = function () { +it('testDeprecatedDateValueFormatter', function() { var opts = { width: 480, height: 320, axes : { x : { valueFormatter: function(x, opts, series_name, dg) { - assertEquals('number', typeof(x)); - assertEquals('function', typeof(opts)); - assertEquals('string', typeof(series_name)); - assertEquals('[Dygraph graph]', dg.toString()); + assert.equal('number', typeof(x)); + assert.equal('function', typeof(opts)); + assert.equal('string', typeof(series_name)); + assert.equal('[Dygraph graph]', dg.toString()); return 'x' + Util.formatDate(x); }, pixelsPerLabel: 60 }, y : { valueFormatter: function(y, opts, series_name, dg) { - assertEquals('number', typeof(y)); - assertEquals('function', typeof(opts)); - assertEquals('string', typeof(series_name)); - assertEquals('[Dygraph graph]', dg.toString()); + assert.equal('number', typeof(y)); + assert.equal('function', typeof(opts)); + assert.equal('string', typeof(series_name)); + assert.equal('[Dygraph graph]', dg.toString()); return 'y' + y; } } @@ -208,17 +208,17 @@ DeprecatedAxisLabelsTestCase.prototype.testDeprecatedDateValueFormatter = functi var g = new Dygraph(graph, data, opts); // valueFormatters do not affect ticks. - assertEquals(["02 Jan","04 Jan","06 Jan","08 Jan"], Util.getXLabels()); - assertEquals(["5","10","15"], Util.getYLabels()); + assert.deepEqual(["02 Jan","04 Jan","06 Jan","08 Jan"], Util.getXLabels()); + assert.deepEqual(["5","10","15"], Util.getYLabels()); // the valueFormatter options also affect the legend. g.setSelection(2); - assertEquals('x2011/01/03: y: y6', Util.getLegend()); -}; + assert.equal('x2011/01/03: y: y6', Util.getLegend()); +}); // This test verifies that when both a valueFormatter and an axisLabelFormatter // are specified, the axisLabelFormatter takes precedence. -DeprecatedAxisLabelsTestCase.prototype.testDeprecatedAxisLabelFormatterPrecedence = function () { +it('testDeprecatedAxisLabelFormatterPrecedence', function() { var opts = { width: 480, height: 320, @@ -249,16 +249,16 @@ DeprecatedAxisLabelsTestCase.prototype.testDeprecatedAxisLabelFormatterPrecedenc var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - assertEquals(['x0','x2','x4','x6','x8'], Util.getXLabels()); - assertEquals(["y0","y5","y10","y15"], Util.getYLabels()); + assert.deepEqual(['x0','x2','x4','x6','x8'], Util.getXLabels()); + assert.deepEqual(["y0","y5","y10","y15"], Util.getYLabels()); g.setSelection(9); - assertEquals("xvf9: y: yvf18", Util.getLegend()); -}; + assert.equal("xvf9: y: yvf18", Util.getLegend()); +}); // This is the same as the previous test, except that options are added // one-by-one. -DeprecatedAxisLabelsTestCase.prototype.testDeprecatedAxisLabelFormatterIncremental = function () { +it('testDeprecatedAxisLabelFormatterIncremental', function() { var opts = { width: 480, height: 320, @@ -307,9 +307,11 @@ DeprecatedAxisLabelsTestCase.prototype.testDeprecatedAxisLabelFormatterIncrement } }); - assertEquals(["x0","x2","x4","x6","x8"], Util.getXLabels()); - assertEquals(["y0","y5","y10","y15"], Util.getYLabels()); + assert.deepEqual(["x0","x2","x4","x6","x8"], Util.getXLabels()); + assert.deepEqual(["y0","y5","y10","y15"], Util.getYLabels()); g.setSelection(9); - assertEquals("xvf9: y: yvf18", Util.getLegend()); -}; + assert.equal("xvf9: y: yvf18", Util.getLegend()); +}); + +}); diff --git a/auto_tests/tests/axis_labels.js b/auto_tests/tests/axis_labels.js index abde4b8..d753159 100644 --- a/auto_tests/tests/axis_labels.js +++ b/auto_tests/tests/axis_labels.js @@ -3,14 +3,14 @@ * * @author dan@dygraphs.com (Dan Vanderkam) */ -var AxisLabelsTestCase = TestCase("axis-labels"); +describe("axis-labels", function() { -AxisLabelsTestCase.prototype.setUp = function() { +beforeEach(function() { document.body.innerHTML = "
"; -}; +}); -AxisLabelsTestCase.prototype.tearDown = function() { -}; +afterEach(function() { +}); var simpleData = "X,Y,Y2\n" + @@ -21,7 +21,7 @@ var simpleData = var kCloseFloat = 1.0e-10; -AxisLabelsTestCase.prototype.testMinusOneToOne = function() { +it('testMinusOneToOne', function() { var opts = { width: 480, height: 320 @@ -37,28 +37,28 @@ AxisLabelsTestCase.prototype.testMinusOneToOne = function() { var g = new Dygraph(graph, data, opts); // TODO(danvk): would ['-1.0','-0.5','0.0','0.5','1.0'] be better? - assertEquals(['-1','-0.5','0','0.5','1'], Util.getYLabels()); + assert.deepEqual(['-1','-0.5','0','0.5','1'], Util.getYLabels()); // Go up to 2 data += "4,2\n"; g.updateOptions({file: data}); - assertEquals(['-1','-0.5','0','0.5','1','1.5','2'], Util.getYLabels()); + assert.deepEqual(['-1','-0.5','0','0.5','1','1.5','2'], Util.getYLabels()); // Now 10 data += "5,10\n"; g.updateOptions({file: data}); - assertEquals(['-2','0','2','4','6','8','10'], Util.getYLabels()); + assert.deepEqual(['-2','0','2','4','6','8','10'], Util.getYLabels()); // Now 100 data += "6,100\n"; g.updateOptions({file: data}); - assertEquals(['0','20','40','60','80','100'], Util.getYLabels()); + assert.deepEqual(['0','20','40','60','80','100'], Util.getYLabels()); g.setSelection(0); - assertEquals('0: Y: -1', Util.getLegend()); -}; + assert.equal('0: Y: -1', Util.getLegend()); +}); -AxisLabelsTestCase.prototype.testSmallRangeNearZero = function() { +it('testSmallRangeNearZero', function() { var opts = { drawAxesAtZero: true, width: 480, @@ -74,24 +74,24 @@ AxisLabelsTestCase.prototype.testSmallRangeNearZero = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - assertEqualsDelta([-0.1,-0.05,0,0.05], + assert.equalsDelta([-0.1,-0.05,0,0.05], Util.makeNumbers(Util.getYLabels()), kCloseFloat); opts.valueRange = [-0.05, 0.05]; g.updateOptions(opts); - assertEquals([-0.04,-0.02,0,0.02,0.04], + assert.deepEqual([-0.04,-0.02,0,0.02,0.04], Util.makeNumbers(Util.getYLabels())); opts.valueRange = [-0.01, 0.01]; g.updateOptions(opts); - assertEquals([-0.01,-0.005,0,0.005], + assert.deepEqual([-0.01,-0.005,0,0.005], Util.makeNumbers(Util.getYLabels())); g.setSelection(1); - assertEquals('1: Y: 0', Util.getLegend()); -}; + assert.equal('1: Y: 0', Util.getLegend()); +}); -AxisLabelsTestCase.prototype.testSmallRangeAwayFromZero = function() { +it('testSmallRangeAwayFromZero', function() { var opts = { width: 480, height: 320 @@ -106,23 +106,23 @@ AxisLabelsTestCase.prototype.testSmallRangeAwayFromZero = function() { opts.valueRange = [9.9, 10.1]; var g = new Dygraph(graph, data, opts); - assertEquals(["9.9","9.92","9.94","9.96","9.98","10","10.02","10.04","10.06","10.08"], Util.getYLabels()); + assert.deepEqual(["9.9","9.92","9.94","9.96","9.98","10","10.02","10.04","10.06","10.08"], Util.getYLabels()); opts.valueRange = [9.99, 10.01]; g.updateOptions(opts); // TODO(danvk): this is bad - assertEquals(["9.99","9.99","9.99","10","10","10","10","10","10.01","10.01"], Util.getYLabels()); + assert.deepEqual(["9.99","9.99","9.99","10","10","10","10","10","10.01","10.01"], Util.getYLabels()); opts.valueRange = [9.999, 10.001]; g.updateOptions(opts); // TODO(danvk): this is even worse! - assertEquals(["10","10","10","10"], Util.getYLabels()); + assert.deepEqual(["10","10","10","10"], Util.getYLabels()); g.setSelection(1); - assertEquals('1: Y: 0', Util.getLegend()); -}; + assert.equal('1: Y: 0', Util.getLegend()); +}); -AxisLabelsTestCase.prototype.testXAxisTimeLabelFormatter = function() { +it('testXAxisTimeLabelFormatter', function() { var opts = { width: 480, height: 320 @@ -148,33 +148,33 @@ AxisLabelsTestCase.prototype.testXAxisTimeLabelFormatter = function() { } }); - assertEquals(["00:05:00","00:05:12","00:05:24","00:05:36","00:05:48"], Util.getXLabels()); + assert.deepEqual(["00:05:00","00:05:12","00:05:24","00:05:36","00:05:48"], Util.getXLabels()); // The legend does not use the axisLabelFormatter: g.setSelection(1); - assertEquals('5.1: Y1: 1', Util.getLegend()); -}; + assert.equal('5.1: Y1: 1', Util.getLegend()); +}); -AxisLabelsTestCase.prototype.testAxisLabelFormatter = function () { +it('testAxisLabelFormatter', function() { var opts = { width: 480, height: 320, axes : { x : { axisLabelFormatter : function(x, granularity, opts, dg) { - assertEquals('number', typeof(x)); - assertEquals('number', typeof(granularity)); - assertEquals('function', typeof(opts)); - assertEquals('[Dygraph graph]', dg.toString()); + assert.equal('number', typeof(x)); + assert.equal('number', typeof(granularity)); + assert.equal('function', typeof(opts)); + assert.equal('[Dygraph graph]', dg.toString()); return 'x' + x; } }, y : { axisLabelFormatter : function(y, granularity, opts, dg) { - assertEquals('number', typeof(y)); - assertEquals('number', typeof(granularity)); - assertEquals('function', typeof(opts)); - assertEquals('[Dygraph graph]', dg.toString()); + assert.equal('number', typeof(y)); + assert.equal('number', typeof(granularity)); + assert.equal('function', typeof(opts)); + assert.equal('[Dygraph graph]', dg.toString()); return 'y' + y; } } @@ -188,14 +188,14 @@ AxisLabelsTestCase.prototype.testAxisLabelFormatter = function () { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - assertEquals(['x0','x2','x4','x6','x8'], Util.getXLabels()); - assertEquals(["y0","y5","y10","y15"], Util.getYLabels()); + assert.deepEqual(['x0','x2','x4','x6','x8'], Util.getXLabels()); + assert.deepEqual(["y0","y5","y10","y15"], Util.getYLabels()); g.setSelection(2); - assertEquals("2: y: 4", Util.getLegend()); -}; + assert.equal("2: y: 4", Util.getLegend()); +}); -AxisLabelsTestCase.prototype.testDateAxisLabelFormatter = function () { +it('testDateAxisLabelFormatter', function() { var opts = { width: 480, height: 320, @@ -203,19 +203,19 @@ AxisLabelsTestCase.prototype.testDateAxisLabelFormatter = function () { x : { pixelsPerLabel: 60, axisLabelFormatter : function(x, granularity, opts, dg) { - assertTrue(Dygraph.isDateLike(x)); - assertEquals('number', typeof(granularity)); - assertEquals('function', typeof(opts)); - assertEquals('[Dygraph graph]', dg.toString()); + assert.isTrue(Dygraph.isDateLike(x)); + assert.equal('number', typeof(granularity)); + assert.equal('function', typeof(opts)); + assert.equal('[Dygraph graph]', dg.toString()); return 'x' + Util.formatDate(x); } }, y : { axisLabelFormatter : function(y, granularity, opts, dg) { - assertEquals('number', typeof(y)); - assertEquals('number', typeof(granularity)); - assertEquals('function', typeof(opts)); - assertEquals('[Dygraph graph]', dg.toString()); + assert.equal('number', typeof(y)); + assert.equal('number', typeof(granularity)); + assert.equal('function', typeof(opts)); + assert.equal('[Dygraph graph]', dg.toString()); return 'y' + y; } } @@ -229,42 +229,42 @@ AxisLabelsTestCase.prototype.testDateAxisLabelFormatter = function () { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - assertEquals(["x2011/01/02","x2011/01/04","x2011/01/06","x2011/01/08"], Util.getXLabels()); - assertEquals(["y5","y10","y15"], Util.getYLabels()); + assert.deepEqual(["x2011/01/02","x2011/01/04","x2011/01/06","x2011/01/08"], Util.getXLabels()); + assert.deepEqual(["y5","y10","y15"], Util.getYLabels()); g.setSelection(0); - assertEquals("2011/01/01: y: 2", Util.getLegend()); -}; + assert.equal("2011/01/01: y: 2", Util.getLegend()); +}); // This test verifies that when a valueFormatter is set (but not an // axisLabelFormatter), then the valueFormatter is used to format the axis // labels. -AxisLabelsTestCase.prototype.testValueFormatter = function () { +it('testValueFormatter', function() { var opts = { width: 480, height: 320, axes: { x: { valueFormatter: function(x, opts, series_name, dg, row, col) { - assertEquals('number', typeof(x)); - assertEquals('function', typeof(opts)); - assertEquals('string', typeof(series_name)); - assertEquals('[Dygraph graph]', dg.toString()); - assertEquals('number', typeof(row)); - assertEquals('number', typeof(col)); - assertEquals(dg, this); + assert.equal('number', typeof(x)); + assert.equal('function', typeof(opts)); + assert.equal('string', typeof(series_name)); + assert.equal('[Dygraph graph]', dg.toString()); + assert.equal('number', typeof(row)); + assert.equal('number', typeof(col)); + assert.equal(dg, this); return 'x' + x; } }, y: { valueFormatter: function(y, opts, series_name, dg, row, col) { - assertEquals('number', typeof(y)); - assertEquals('function', typeof(opts)); - assertEquals('string', typeof(series_name)); - assertEquals('[Dygraph graph]', dg.toString()); - assertEquals('number', typeof(row)); - assertEquals('number', typeof(col)); - assertEquals(dg, this); + assert.equal('number', typeof(y)); + assert.equal('function', typeof(opts)); + assert.equal('string', typeof(series_name)); + assert.equal('[Dygraph graph]', dg.toString()); + assert.equal('number', typeof(row)); + assert.equal('number', typeof(col)); + assert.equal(dg, this); return 'y' + y; } } @@ -279,16 +279,16 @@ AxisLabelsTestCase.prototype.testValueFormatter = function () { var g = new Dygraph(graph, data, opts); // the valueFormatter options do not affect the ticks. - assertEquals(['0','2','4','6','8'], Util.getXLabels()); - assertEquals(["0","5","10","15"], + assert.deepEqual(['0','2','4','6','8'], Util.getXLabels()); + assert.deepEqual(["0","5","10","15"], Util.getYLabels()); // they do affect the legend, however. g.setSelection(2); - assertEquals("x2: y: y4", Util.getLegend()); -}; + assert.equal("x2: y: y4", Util.getLegend()); +}); -AxisLabelsTestCase.prototype.testDateValueFormatter = function () { +it('testDateValueFormatter', function() { var opts = { width: 480, height: 320, @@ -296,25 +296,25 @@ AxisLabelsTestCase.prototype.testDateValueFormatter = function () { x : { pixelsPerLabel: 60, valueFormatter: function(x, opts, series_name, dg, row, col) { - assertEquals('number', typeof(x)); - assertEquals('function', typeof(opts)); - assertEquals('string', typeof(series_name)); - assertEquals('[Dygraph graph]', dg.toString()); - assertEquals('number', typeof(row)); - assertEquals('number', typeof(col)); - assertEquals(dg, this); + assert.equal('number', typeof(x)); + assert.equal('function', typeof(opts)); + assert.equal('string', typeof(series_name)); + assert.equal('[Dygraph graph]', dg.toString()); + assert.equal('number', typeof(row)); + assert.equal('number', typeof(col)); + assert.equal(dg, this); return 'x' + Util.formatDate(x); } }, y : { valueFormatter: function(y, opts, series_name, dg, row, col) { - assertEquals('number', typeof(y)); - assertEquals('function', typeof(opts)); - assertEquals('string', typeof(series_name)); - assertEquals('[Dygraph graph]', dg.toString()); - assertEquals('number', typeof(row)); - assertEquals('number', typeof(col)); - assertEquals(dg, this); + assert.equal('number', typeof(y)); + assert.equal('function', typeof(opts)); + assert.equal('string', typeof(series_name)); + assert.equal('[Dygraph graph]', dg.toString()); + assert.equal('number', typeof(row)); + assert.equal('number', typeof(col)); + assert.equal(dg, this); return 'y' + y; } } @@ -330,38 +330,38 @@ AxisLabelsTestCase.prototype.testDateValueFormatter = function () { var g = new Dygraph(graph, data, opts); // valueFormatters do not affect ticks. - assertEquals(["02 Jan","04 Jan","06 Jan","08 Jan"], Util.getXLabels()); - assertEquals(["5","10","15"], Util.getYLabels()); + assert.deepEqual(["02 Jan","04 Jan","06 Jan","08 Jan"], Util.getXLabels()); + assert.deepEqual(["5","10","15"], Util.getYLabels()); // the valueFormatter options also affect the legend. g.setSelection(2); - assertEquals('x2011/01/03: y: y6', Util.getLegend()); -}; + assert.equal('x2011/01/03: y: y6', Util.getLegend()); +}); // This test verifies that when both a valueFormatter and an axisLabelFormatter // are specified, the axisLabelFormatter takes precedence. -AxisLabelsTestCase.prototype.testAxisLabelFormatterPrecedence = function () { +it('testAxisLabelFormatterPrecedence', function() { var opts = { width: 480, height: 320, axes : { x : { valueFormatter: function(x) { - assertEquals('[Dygraph graph]', this.toString()); + assert.equal('[Dygraph graph]', this.toString()); return 'xvf' + x; }, axisLabelFormatter: function(x, granularity) { - assertEquals('[Dygraph graph]', this.toString()); + assert.equal('[Dygraph graph]', this.toString()); return 'x' + x; } }, y : { valueFormatter: function(y) { - assertEquals('[Dygraph graph]', this.toString()); + assert.equal('[Dygraph graph]', this.toString()); return 'yvf' + y; }, axisLabelFormatter: function(y) { - assertEquals('[Dygraph graph]', this.toString()); + assert.equal('[Dygraph graph]', this.toString()); return 'y' + y; } } @@ -375,16 +375,16 @@ AxisLabelsTestCase.prototype.testAxisLabelFormatterPrecedence = function () { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - assertEquals(['x0','x2','x4','x6','x8'], Util.getXLabels()); - assertEquals(["y0","y5","y10","y15"], Util.getYLabels()); + assert.deepEqual(['x0','x2','x4','x6','x8'], Util.getXLabels()); + assert.deepEqual(["y0","y5","y10","y15"], Util.getYLabels()); g.setSelection(9); - assertEquals("xvf9: y: yvf18", Util.getLegend()); -}; + assert.equal("xvf9: y: yvf18", Util.getLegend()); +}); // This is the same as the previous test, except that options are added // one-by-one. -AxisLabelsTestCase.prototype.testAxisLabelFormatterIncremental = function () { +it('testAxisLabelFormatterIncremental', function() { var opts = { width: 480, height: 320, @@ -433,24 +433,24 @@ AxisLabelsTestCase.prototype.testAxisLabelFormatterIncremental = function () { } }); - assertEquals(["x0","x2","x4","x6","x8"], Util.getXLabels()); - assertEquals(["y0","y5","y10","y15"], Util.getYLabels()); + assert.deepEqual(["x0","x2","x4","x6","x8"], Util.getXLabels()); + assert.deepEqual(["y0","y5","y10","y15"], Util.getYLabels()); g.setSelection(9); - assertEquals("xvf9: y: yvf18", Util.getLegend()); -}; + assert.equal("xvf9: y: yvf18", Util.getLegend()); +}); -AxisLabelsTestCase.prototype.testGlobalFormatters = function() { +it('testGlobalFormatters', function() { var opts = { width: 480, height: 320, labels: ['x', 'y'], valueFormatter: function(x) { - assertEquals('[Dygraph graph]', this); + assert.equal('[Dygraph graph]', this); return 'vf' + x; }, axisLabelFormatter: function(x) { - assertEquals('[Dygraph graph]', this); + assert.equal('[Dygraph graph]', this); return 'alf' + x; } }; @@ -461,14 +461,14 @@ AxisLabelsTestCase.prototype.testGlobalFormatters = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - assertEquals(['alf0','alf2','alf4','alf6','alf8'], Util.getXLabels()); - assertEquals(["alf0","alf5","alf10","alf15"], Util.getYLabels()); + assert.deepEqual(['alf0','alf2','alf4','alf6','alf8'], Util.getXLabels()); + assert.deepEqual(["alf0","alf5","alf10","alf15"], Util.getYLabels()); g.setSelection(9); - assertEquals("vf9: y: vf18", Util.getLegend()); -}; + assert.equal("vf9: y: vf18", Util.getLegend()); +}); -AxisLabelsTestCase.prototype.testValueFormatterParameters = function() { +it('testValueFormatterParameters', function() { var calls = []; // change any functions in list to 'fn' -- functions can't be asserted. var killFunctions = function(list) { @@ -507,9 +507,9 @@ AxisLabelsTestCase.prototype.testValueFormatterParameters = function() { var graph = document.getElementById('graph'); var g = new Dygraph(graph, data, opts); - assertEquals([], calls); + assert.deepEqual([], calls); g.setSelection(0); - assertEquals([ + assert.deepEqual([ // num or millis, opts, series, dygraph, row, col [ 'x', g, 0, 'fn', 'x', g, 0, 0], [ 'y', g, 1, 'fn', 'y1', g, 0, 1], @@ -518,14 +518,14 @@ AxisLabelsTestCase.prototype.testValueFormatterParameters = function() { calls = []; g.setSelection(1); - assertEquals([ + assert.deepEqual([ [ 'x', g, 1, 'fn', 'x', g, 1, 0], [ 'y', g, 3, 'fn', 'y1', g, 1, 1], ['y2', g, 4, 'fn', 'y2', g, 1, 2] ], calls); -}; +}); -AxisLabelsTestCase.prototype.testSeriesOrder = function() { +it('testSeriesOrder', function() { var opts = { width: 480, height: 320 @@ -541,18 +541,18 @@ AxisLabelsTestCase.prototype.testSeriesOrder = function() { var g = new Dygraph(graph, data, opts); g.setSelection(2); - assertEquals('2: 00: 103 01: 203 10: 303 11: 403', Util.getLegend()); + assert.equal('2: 00: 103 01: 203 10: 303 11: 403', Util.getLegend()); // Sanity checks for indexFromSetName - assertEquals(0, g.indexFromSetName("x")); - assertEquals(1, g.indexFromSetName("00")); - assertEquals(null, g.indexFromSetName("abcde")); + assert.equal(0, g.indexFromSetName("x")); + assert.equal(1, g.indexFromSetName("00")); + assert.equal(null, g.indexFromSetName("abcde")); // Verify that we get the label list back in the right order - assertEquals(["x", "00", "01", "10", "11"], g.getLabels()); -}; + assert.deepEqual(["x", "00", "01", "10", "11"], g.getLabels()); +}); -AxisLabelsTestCase.prototype.testLabelKMB = function() { +it('testLabelKMB', function() { var data = []; data.push([0,0]); data.push([1,2000]); @@ -571,10 +571,10 @@ AxisLabelsTestCase.prototype.testLabelKMB = function() { } ); - assertEquals(["0", "500", "1K", "1.5K", "2K"], Util.getYLabels()); -}; + assert.deepEqual(["0", "500", "1K", "1.5K", "2K"], Util.getYLabels()); +}); -AxisLabelsTestCase.prototype.testLabelKMG2 = function() { +it('testLabelKMG2', function() { var data = []; data.push([0,0]); data.push([1,2000]); @@ -593,14 +593,14 @@ AxisLabelsTestCase.prototype.testLabelKMG2 = function() { } ); - assertEquals( + assert.equal( ["0","256","512","768","1k","1.25k","1.5k","1.75k","2k"], Util.getYLabels()); -}; +}); // Same as testLabelKMG2 but specifies the option at the // top of the option dictionary. -AxisLabelsTestCase.prototype.testLabelKMG2_top = function() { +it('testLabelKMG2_top', function() { var data = []; data.push([0,0]); data.push([1,2000]); @@ -615,40 +615,40 @@ AxisLabelsTestCase.prototype.testLabelKMG2_top = function() { } ); - assertEquals( + assert.equal( ["0","256","512","768","1k","1.25k","1.5k","1.75k","2k"], Util.getYLabels()); -}; +}); /** * Verify that log scale axis range is properly specified. */ -AxisLabelsTestCase.prototype.testLogScale = function() { +it('testLogScale', function() { var g = new Dygraph("graph", [[0, 5], [1, 1000]], { logscale : true }); var nonEmptyLabels = Util.getYLabels().filter(function(x) { return x.length > 0; }); - assertEquals(["5","10","20","50","100","200","500","1000"], nonEmptyLabels); + assert.deepEqual(["5","10","20","50","100","200","500","1000"], nonEmptyLabels); g.updateOptions({ logscale : false }); - assertEquals(['0','200','400','600','800','1000'], Util.getYLabels()); -} + assert.deepEqual(['0','200','400','600','800','1000'], Util.getYLabels()); +}); /** * Verify that include zero range is properly specified. */ -AxisLabelsTestCase.prototype.testIncludeZero = function() { +it('testIncludeZero', function() { var g = new Dygraph("graph", [[0, 500], [1, 1000]], { includeZero : true }); - assertEquals(['0','200','400','600','800','1000'], Util.getYLabels()); + assert.deepEqual(['0','200','400','600','800','1000'], Util.getYLabels()); g.updateOptions({ includeZero : false }); - assertEquals(['500','600','700','800','900','1000'], Util.getYLabels()); -} + assert.deepEqual(['500','600','700','800','900','1000'], Util.getYLabels()); +}); -AxisLabelsTestCase.prototype.testAxisLabelFontSize = function() { +it('testAxisLabelFontSize', function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, simpleData, {}); // Be sure we're dealing with a 14-point default. - assertEquals(14, Dygraph.DEFAULT_ATTRS.axisLabelFontSize); + assert.equal(14, Dygraph.DEFAULT_ATTRS.axisLabelFontSize); var assertFontSize = function(selector, expected) { Util.assertStyleOfChildren(selector, "font-size", expected); @@ -692,9 +692,9 @@ AxisLabelsTestCase.prototype.testAxisLabelFontSize = function() { assertFontSize($(".dygraph-axis-label-x"), "5px"); assertFontSize($(".dygraph-axis-label-y1"), "20px"); assertFontSize($(".dygraph-axis-label-y2"), "12px"); -} +}); -AxisLabelsTestCase.prototype.testAxisLabelFontSizeNull = function() { +it('testAxisLabelFontSizeNull', function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, simpleData, { @@ -706,18 +706,18 @@ AxisLabelsTestCase.prototype.testAxisLabelFontSizeNull = function() { }; // Be sure we're dealing with a 14-point default. - assertEquals(14, Dygraph.DEFAULT_ATTRS.axisLabelFontSize); + assert.equal(14, Dygraph.DEFAULT_ATTRS.axisLabelFontSize); assertFontSize($(".dygraph-axis-label-x"), "14px"); assertFontSize($(".dygraph-axis-label-y"), "14px"); -} +}); -AxisLabelsTestCase.prototype.testAxisLabelColor = function() { +it('testAxisLabelColor', function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, simpleData, {}); // Be sure we're dealing with a black default. - assertEquals("black", Dygraph.DEFAULT_ATTRS.axisLabelColor); + assert.equal("black", Dygraph.DEFAULT_ATTRS.axisLabelColor); var assertColor = function(selector, expected) { Util.assertStyleOfChildren(selector, "color", expected); @@ -761,9 +761,9 @@ AxisLabelsTestCase.prototype.testAxisLabelColor = function() { assertColor($(".dygraph-axis-label-x"), "rgb(0, 0, 255)"); assertColor($(".dygraph-axis-label-y1"), "rgb(0, 128, 0)"); assertColor($(".dygraph-axis-label-y2"), "rgb(255, 255, 0)"); -} +}); -AxisLabelsTestCase.prototype.testAxisLabelColorNull = function() { +it('testAxisLabelColorNull', function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, simpleData, { @@ -775,16 +775,16 @@ AxisLabelsTestCase.prototype.testAxisLabelColorNull = function() { } // Be sure we're dealing with a 14-point default. - assertEquals(14, Dygraph.DEFAULT_ATTRS.axisLabelFontSize); + assert.equal(14, Dygraph.DEFAULT_ATTRS.axisLabelFontSize); assertColor($(".dygraph-axis-label-x"), "rgb(0, 0, 0)"); assertColor($(".dygraph-axis-label-y"), "rgb(0, 0, 0)"); -} +}); /* * This test shows that the label formatter overrides labelsKMB for all values. */ -AxisLabelsTestCase.prototype.testLabelFormatterOverridesLabelsKMB = function() { +it('testLabelFormatterOverridesLabelsKMB', function() { var g = new Dygraph( document.getElementById("graph"), "X,a,b\n" + @@ -797,14 +797,14 @@ AxisLabelsTestCase.prototype.testLabelFormatterOverridesLabelsKMB = function() { return v + ":X"; } }); - assertEquals(["0:X","500:X","1000:X","1500:X","2000:X"], Util.getYLabels()); - assertEquals(["1:X","2:X","3:X"], Util.getXLabels()); -} + assert.deepEqual(["0:X","500:X","1000:X","1500:X","2000:X"], Util.getYLabels()); + assert.deepEqual(["1:X","2:X","3:X"], Util.getXLabels()); +}); /* * This test shows that you can override labelsKMB on the axis level. */ -AxisLabelsTestCase.prototype.testLabelsKMBPerAxis = function() { +it('testLabelsKMBPerAxis', function() { var g = new Dygraph( document.getElementById("graph"), "x,a,b\n" + @@ -824,15 +824,15 @@ AxisLabelsTestCase.prototype.testLabelsKMBPerAxis = function() { // labelsKMB doesn't apply to the x axis. This value should be different. // BUG : https://code.google.com/p/dygraphs/issues/detail?id=488 - assertEquals(["1000","2000","3000"], Util.getXLabels()); - assertEquals( ["0","500","1000","1500","2000"], Util.getYLabels(1)); - assertEquals(["0","500","1K","1.5K","2K"], Util.getYLabels(2)); -}; + assert.deepEqual(["1000","2000","3000"], Util.getXLabels()); + assert.equal( ["0","500","1000","1500","2000"], Util.getYLabels(1)); + assert.deepEqual(["0","500","1K","1.5K","2K"], Util.getYLabels(2)); +}); /* * This test shows that you can override labelsKMG2 on the axis level. */ -AxisLabelsTestCase.prototype.testLabelsKMBG2IPerAxis = function() { +it('testLabelsKMBG2IPerAxis', function() { var g = new Dygraph( document.getElementById("graph"), "x,a,b\n" + @@ -854,15 +854,15 @@ AxisLabelsTestCase.prototype.testLabelsKMBG2IPerAxis = function() { // Plus I can't be sure they're doing the same thing as they're done in different // bits of code. // BUG : https://code.google.com/p/dygraphs/issues/detail?id=488 - assertEquals(["1024","2048","3072"], Util.getXLabels()); - assertEquals( ["0","500","1000","1500","2000"], Util.getYLabels(1)); - assertEquals(["0","500","1000","1.46k","1.95k"], Util.getYLabels(2)); -}; + assert.deepEqual(["1024","2048","3072"], Util.getXLabels()); + assert.equal( ["0","500","1000","1500","2000"], Util.getYLabels(1)); + assert.deepEqual(["0","500","1000","1.46k","1.95k"], Util.getYLabels(2)); +}); /** * This test shows you can override sigFigs on the axis level. */ -AxisLabelsTestCase.prototype.testSigFigsPerAxis = function() { +it('testSigFigsPerAxis', function() { var g = new Dygraph( document.getElementById("graph"), "x,a,b\n" + @@ -882,15 +882,15 @@ AxisLabelsTestCase.prototype.testSigFigsPerAxis = function() { }); // sigFigs doesn't apply to the x axis. This value should be different. // BUG : https://code.google.com/p/dygraphs/issues/detail?id=488 - assertEquals(["1000","2000","3000"], Util.getXLabels()); - assertEquals(["0.0","5.0e+2","1.0e+3","1.5e+3","2.0e+3"], Util.getYLabels(1)); - assertEquals(["0.00000","500.000","1000.00","1500.00","2000.00"], Util.getYLabels(2)); -} + assert.deepEqual(["1000","2000","3000"], Util.getXLabels()); + assert.deepEqual(["0.0","5.0e+2","1.0e+3","1.5e+3","2.0e+3"], Util.getYLabels(1)); + assert.deepEqual(["0.00000","500.000","1000.00","1500.00","2000.00"], Util.getYLabels(2)); +}); /** * This test shows you can override digitsAfterDecimal on the axis level. */ -AxisLabelsTestCase.prototype.testDigitsAfterDecimalPerAxis = function() { +it('testDigitsAfterDecimalPerAxis', function() { var g = new Dygraph( document.getElementById("graph"), "x,a,b\n" + @@ -906,40 +906,40 @@ AxisLabelsTestCase.prototype.testDigitsAfterDecimalPerAxis = function() { }); g.updateOptions({ axes: { y: { digitsAfterDecimal: 3 }}}); - assertEquals(["0.001","0.002","0.002","0.003","0.003","0.004","0.004"], Util.getYLabels(1)); + assert.deepEqual(["0.001","0.002","0.002","0.003","0.003","0.004","0.004"], Util.getYLabels(1)); g.updateOptions({ axes: { y: { digitsAfterDecimal: 4 }}}); - assertEquals(["0.001","0.0015","0.002","0.0025","0.003","0.0035","0.004"], Util.getYLabels(1)); + assert.deepEqual(["0.001","0.0015","0.002","0.0025","0.003","0.0035","0.004"], Util.getYLabels(1)); g.updateOptions({ axes: { y: { digitsAfterDecimal: 5 }}}); - assertEquals(["0.001","0.0015","0.002","0.0025","0.003","0.0035","0.004"], Util.getYLabels(1)); + assert.deepEqual(["0.001","0.0015","0.002","0.0025","0.003","0.0035","0.004"], Util.getYLabels(1)); g.updateOptions({ axes: { y: { digitsAfterDecimal: null }}}); - assertEquals(["1e-3","2e-3","2e-3","3e-3","3e-3","4e-3","4e-3"], Util.getYLabels(1)); + assert.deepEqual(["1e-3","2e-3","2e-3","3e-3","3e-3","4e-3","4e-3"], Util.getYLabels(1)); g.updateOptions({ axes: { y2: { digitsAfterDecimal: 3 }}}); - assertEquals(["0.005","0.006","0.006","0.007","0.007","0.008","0.008"], Util.getYLabels(2)); + assert.deepEqual(["0.005","0.006","0.006","0.007","0.007","0.008","0.008"], Util.getYLabels(2)); g.updateOptions({ axes: { y2: { digitsAfterDecimal: 4 }}}); - assertEquals(["0.005","0.0055","0.006","0.0065","0.007","0.0075","0.008"], Util.getYLabels(2)); + assert.deepEqual(["0.005","0.0055","0.006","0.0065","0.007","0.0075","0.008"], Util.getYLabels(2)); g.updateOptions({ axes: { y2: { digitsAfterDecimal: 5 }}}); - assertEquals(["0.005","0.0055","0.006","0.0065","0.007","0.0075","0.008"], Util.getYLabels(2)); + assert.deepEqual(["0.005","0.0055","0.006","0.0065","0.007","0.0075","0.008"], Util.getYLabels(2)); g.updateOptions({ axes: { y2: { digitsAfterDecimal: null }}}); - assertEquals(["5e-3","6e-3","6e-3","7e-3","7e-3","7e-3","8e-3"], Util.getYLabels(2)); + assert.deepEqual(["5e-3","6e-3","6e-3","7e-3","7e-3","7e-3","8e-3"], Util.getYLabels(2)); // digitsAfterDecimal is ignored for the x-axis. // BUG : https://code.google.com/p/dygraphs/issues/detail?id=488 g.updateOptions({ axes: { x: { digitsAfterDecimal: 3 }}}); - assertEquals(["0.006","0.007","0.008"], Util.getXLabels()); + assert.deepEqual(["0.006","0.007","0.008"], Util.getXLabels()); g.updateOptions({ axes: { x: { digitsAfterDecimal: 4 }}}); - assertEquals(["0.006","0.007","0.008"], Util.getXLabels()); + assert.deepEqual(["0.006","0.007","0.008"], Util.getXLabels()); g.updateOptions({ axes: { x: { digitsAfterDecimal: 5 }}}); - assertEquals(["0.006","0.007","0.008"], Util.getXLabels()); + assert.deepEqual(["0.006","0.007","0.008"], Util.getXLabels()); g.updateOptions({ axes: { x: { digitsAfterDecimal: null }}}); - assertEquals(["0.006","0.007","0.008"], Util.getXLabels()); -} + assert.deepEqual(["0.006","0.007","0.008"], Util.getXLabels()); +}); /** * This test shows you can override digitsAfterDecimal on the axis level. */ -AxisLabelsTestCase.prototype.testMaxNumberWidthPerAxis = function() { +it('testMaxNumberWidthPerAxis', function() { var g = new Dygraph( document.getElementById("graph"), "x,a,b\n" + @@ -954,33 +954,33 @@ AxisLabelsTestCase.prototype.testMaxNumberWidthPerAxis = function() { }); g.updateOptions({ axes: { y: { maxNumberWidth: 4 }}}); - assertEquals(["1.26e+4","1.26e+4","1.26e+4","1.26e+4","1.26e+4","1.26e+4","1.26e+4"] , Util.getYLabels(1)); + assert.deepEqual(["1.26e+4","1.26e+4","1.26e+4","1.26e+4","1.26e+4","1.26e+4","1.26e+4"] , Util.getYLabels(1)); g.updateOptions({ axes: { y: { maxNumberWidth: 5 }}}); - assertEquals(["12601","12601.5","12602","12602.5","12603","12603.5","12604"] , Util.getYLabels(1)); + assert.deepEqual(["12601","12601.5","12602","12602.5","12603","12603.5","12604"] , Util.getYLabels(1)); g.updateOptions({ axes: { y: { maxNumberWidth: null }}}); - assertEquals(["1.26e+4","1.26e+4","1.26e+4","1.26e+4","1.26e+4","1.26e+4","1.26e+4"] , Util.getYLabels(1)); + assert.deepEqual(["1.26e+4","1.26e+4","1.26e+4","1.26e+4","1.26e+4","1.26e+4","1.26e+4"] , Util.getYLabels(1)); g.updateOptions({ axes: { y2: { maxNumberWidth: 4 }}}); - assertEquals(["1.28e+4","1.28e+4","1.28e+4","1.28e+4","1.28e+4","1.28e+4","1.28e+4"], Util.getYLabels(2)); + assert.deepEqual(["1.28e+4","1.28e+4","1.28e+4","1.28e+4","1.28e+4","1.28e+4","1.28e+4"], Util.getYLabels(2)); g.updateOptions({ axes: { y2: { maxNumberWidth: 5 }}}); - assertEquals(["12801","12801.5","12802","12802.5","12803","12803.5","12804"], Util.getYLabels(2)); + assert.deepEqual(["12801","12801.5","12802","12802.5","12803","12803.5","12804"], Util.getYLabels(2)); g.updateOptions({ axes: { y2: { maxNumberWidth: null }}}); - assertEquals(["1.28e+4","1.28e+4","1.28e+4","1.28e+4","1.28e+4","1.28e+4","1.28e+4"], Util.getYLabels(2)); + assert.deepEqual(["1.28e+4","1.28e+4","1.28e+4","1.28e+4","1.28e+4","1.28e+4","1.28e+4"], Util.getYLabels(2)); // maxNumberWidth is ignored for the x-axis. // BUG : https://code.google.com/p/dygraphs/issues/detail?id=488 g.updateOptions({ axes: { x: { maxNumberWidth: 4 }}}); - assertEquals(["12401","12402","12403"], Util.getXLabels()); + assert.deepEqual(["12401","12402","12403"], Util.getXLabels()); g.updateOptions({ axes: { x: { maxNumberWidth: 5 }}}); - assertEquals(["12401","12402","12403"], Util.getXLabels()); + assert.deepEqual(["12401","12402","12403"], Util.getXLabels()); g.updateOptions({ axes: { x: { maxNumberWidth: null }}}); - assertEquals(["12401","12402","12403"], Util.getXLabels()); -} + assert.deepEqual(["12401","12402","12403"], Util.getXLabels()); +}); /* // Regression test for http://code.google.com/p/dygraphs/issues/detail?id=147 // Checks that axis labels stay sane across a DST change. -AxisLabelsTestCase.prototype.testLabelsCrossDstChange = function() { +it('testLabelsCrossDstChange', function() { // (From tests/daylight-savings.html) var g = new Dygraph( document.getElementById("graph"), @@ -1007,7 +1007,7 @@ AxisLabelsTestCase.prototype.testLabelsCrossDstChange = function() { var xLabels = Util.getXLabels(); for (var i = 0; i < xLabels.length; i++) { - assertTrue(okLabels[xLabels[i]]); + assert.isTrue(okLabels[xLabels[i]]); } // This range had issues of its own on tests/daylight-savings.html. @@ -1016,14 +1016,14 @@ AxisLabelsTestCase.prototype.testLabelsCrossDstChange = function() { }); xLabels = Util.getXLabels(); for (var i = 0; i < xLabels.length; i++) { - assertTrue(okLabels[xLabels[i]]); + assert.isTrue(okLabels[xLabels[i]]); } -}; +}); // Tests data which crosses a "fall back" at a high enough frequency that you // can see both 1:00 A.M.s. -AxisLabelsTestCase.prototype.testLabelsCrossDstChangeHighFreq = function() { +it('testLabelsCrossDstChangeHighFreq', function() { // Generate data which crosses the EST/EDT boundary. var dst_data = []; var base_ms = 1383454200000; @@ -1037,7 +1037,7 @@ AxisLabelsTestCase.prototype.testLabelsCrossDstChangeHighFreq = function() { { width: 1024, labels: ['Date', 'Value'] } ); - assertEquals([ + assert.deepEqual([ '00:50', '00:55', '01:00', '01:05', '01:10', '01:15', '01:20', '01:25', '01:30', '01:35', '01:40', '01:45', '01:50', '01:55', @@ -1048,17 +1048,17 @@ AxisLabelsTestCase.prototype.testLabelsCrossDstChangeHighFreq = function() { g.updateOptions({ dateWindow: [1383454200000 + 15*60*1000, g.xAxisExtremes()[1]]} ); - assertEquals([ + assert.deepEqual([ '01:05', '01:10', '01:15', '01:20', '01:25', '01:30', '01:35', '01:40', '01:45', '01:50', '01:55', '01:00', '01:05' // 1 AM number two! ], Util.getXLabels()); -}; +}); // Tests data which crosses a "spring forward" at a low frequency. // Regression test for http://code.google.com/p/dygraphs/issues/detail?id=433 -AxisLabelsTestCase.prototype.testLabelsCrossSpringForward = function() { +it('testLabelsCrossSpringForward', function() { var g = new Dygraph( document.getElementById("graph"), "Date/Time,Purchases\n" + @@ -1090,11 +1090,11 @@ AxisLabelsTestCase.prototype.testLabelsCrossSpringForward = function() { var xLabels = Util.getXLabels(); for (var i = 0; i < xLabels.length; i++) { - assertTrue(okLabels[xLabels[i]]); + assert.isTrue(okLabels[xLabels[i]]); } -}; +}); -AxisLabelsTestCase.prototype.testLabelsCrossSpringForwardHighFreq = function() { +it('testLabelsCrossSpringForwardHighFreq', function() { var base_ms_spring = 1299999000000; var dst_data_spring = []; for (var x = base_ms_spring; x < base_ms_spring + 1000 * 60 * 80; x += 1000) { @@ -1107,11 +1107,13 @@ AxisLabelsTestCase.prototype.testLabelsCrossSpringForwardHighFreq = function() { { width: 1024, labels: ['Date', 'Value'] } ); - assertEquals([ + assert.deepEqual([ '01:50', '01:55', '03:00', '03:05', '03:10', '03:15', '03:20', '03:25', '03:30', '03:35', '03:40', '03:45', '03:50', '03:55', '04:00', '04:05' ], Util.getXLabels()); -}; +}); */ + +}); diff --git a/auto_tests/tests/callback.js b/auto_tests/tests/callback.js index 7958c3f..142fa88 100644 --- a/auto_tests/tests/callback.js +++ b/auto_tests/tests/callback.js @@ -4,23 +4,23 @@ * @author uemit.seren@gmail.com (Ümit Seren) */ -var CallbackTestCase = TestCase("callback"); +describe("callback", function() { var xhr, styleSheet; -CallbackTestCase.prototype.setUp = function() { +beforeEach(function() { document.body.innerHTML = "
"; xhr = XMLHttpRequest; styleSheet = document.createElement("style"); styleSheet.type = "text/css"; document.getElementsByTagName("head")[0].appendChild(styleSheet); -}; +}); -CallbackTestCase.prototype.tearDown = function() { - XMLHttpRequest = xhr; -}; +afterEach(function() { + window.XMLHttpRequest = xhr; +}); -var data = "X,a\,b,c\n" + +var data = "X,a,b,c\n" + "10,-1,1,2\n" + "11,0,3,1\n" + "12,1,4,2\n" + @@ -32,12 +32,12 @@ var data = "X,a\,b,c\n" + * is properly called when the first series is hidden (setVisibility = false) * */ -CallbackTestCase.prototype.testHighlightCallbackIsCalled = function() { +it('testHighlightCallbackIsCalled', function() { var h_row; var h_pts; var highlightCallback = function(e, x, pts, row) { - assertEquals(g, this); + assert.equal(g, this); h_row = row; h_pts = pts; }; @@ -54,20 +54,20 @@ CallbackTestCase.prototype.testHighlightCallbackIsCalled = function() { DygraphOps.dispatchMouseMove(g, 13, 10); //check correct row is returned - assertEquals(3, h_row); + assert.equal(3, h_row); //check there are only two points (because first series is hidden) - assertEquals(2, h_pts.length); -}; + assert.equal(2, h_pts.length); +}); /** * Test that drawPointCallback isn't called when drawPoints is false */ -CallbackTestCase.prototype.testDrawPointCallback_disabled = function() { +it('testDrawPointCallback_disabled', function() { var called = false; var callback = function() { - assertEquals(g, this); + assert.equal(g, this); called = true; }; @@ -76,13 +76,13 @@ CallbackTestCase.prototype.testDrawPointCallback_disabled = function() { drawPointCallback: callback, }); - assertFalse(called); -}; + assert.isFalse(called); +}); /** * Test that drawPointCallback is called when drawPoints is true */ -CallbackTestCase.prototype.testDrawPointCallback_enabled = function() { +it('testDrawPointCallback_enabled', function() { var called = false; var callbackThis = null; @@ -97,19 +97,19 @@ CallbackTestCase.prototype.testDrawPointCallback_enabled = function() { drawPointCallback: callback }); - assertTrue(called); - assertEquals(g, callbackThis); -}; + assert.isTrue(called); + assert.equal(g, callbackThis); +}); /** * Test that drawPointCallback is called when drawPoints is true */ -CallbackTestCase.prototype.testDrawPointCallback_pointSize = function() { +it('testDrawPointCallback_pointSize', function() { var pointSize = 0; var count = 0; var callback = function(g, seriesName, canvasContext, cx, cy, color, pointSizeParam) { - assertEquals(g, this); + assert.equal(g, this); pointSize = pointSizeParam; count++; }; @@ -120,8 +120,8 @@ CallbackTestCase.prototype.testDrawPointCallback_pointSize = function() { drawPointCallback: callback }); - assertEquals(1.5, pointSize); - assertEquals(12, count); // one call per data point. + assert.equal(1.5, pointSize); + assert.equal(12, count); // one call per data point. var g = new Dygraph(graph, data, { drawPoints: true, @@ -129,19 +129,19 @@ CallbackTestCase.prototype.testDrawPointCallback_pointSize = function() { pointSize: 8 }); - assertEquals(8, pointSize); -}; + assert.equal(8, pointSize); +}); /** * Test that drawPointCallback is called for isolated points when * drawPoints is false, and also for gap points if that's enabled. */ -CallbackTestCase.prototype.testDrawPointCallback_isolated = function() { +it('testDrawPointCallback_isolated', function() { var xvalues = []; var g; var callback = function(g, seriesName, canvasContext, cx, cy, color, pointSizeParam) { - assertEquals(g, this); + assert.equal(g, this); var dx = g.toDataXCoord(cx); xvalues.push(dx); Dygraph.Circles.DEFAULT.apply(this, arguments); @@ -159,9 +159,9 @@ CallbackTestCase.prototype.testDrawPointCallback_isolated = function() { // Test that isolated points get drawn g = new Dygraph(graph, testdata, graphOpts); - assertEquals(2, xvalues.length); - assertEquals(13, xvalues[0]); - assertEquals(15, xvalues[1]); + assert.equal(2, xvalues.length); + assert.equal(13, xvalues[0]); + assert.equal(15, xvalues[1]); // Test that isolated points + gap points get drawn when // drawGapEdgePoints is set. This should add one point at the right @@ -169,22 +169,22 @@ CallbackTestCase.prototype.testDrawPointCallback_isolated = function() { xvalues = []; // Reset for new test graphOpts.drawGapEdgePoints = true; g = new Dygraph(graph, testdata, graphOpts); - assertEquals(3, xvalues.length); - assertEquals(11, xvalues[0]); - assertEquals(13, xvalues[1]); - assertEquals(15, xvalues[2]); -}; + assert.equal(3, xvalues.length); + assert.equal(11, xvalues[0]); + assert.equal(13, xvalues[1]); + assert.equal(15, xvalues[2]); +}); /** * This tests that when the function idxToRow_ returns the proper row and the onHiglightCallback * is properly called when the first series is hidden (setVisibility = false) * */ -CallbackTestCase.prototype.testDrawHighlightPointCallbackIsCalled = function() { +it('testDrawHighlightPointCallbackIsCalled', function() { var called = false; var drawHighlightPointCallback = function() { - assertEquals(g, this); + assert.equal(g, this); called = true; }; @@ -196,10 +196,10 @@ CallbackTestCase.prototype.testDrawHighlightPointCallbackIsCalled = function() { drawHighlightPointCallback: drawHighlightPointCallback }); - assertFalse(called); + assert.isFalse(called); DygraphOps.dispatchMouseMove(g, 13, 10); - assertTrue(called); -}; + assert.isTrue(called); +}); /** * Test the closest-series highlighting methods for normal and stacked modes. @@ -230,7 +230,7 @@ var runClosestTest = function(isStacked, widthNormal, widthHighlighted) { }); var highlightCallback = function(e, x, pts, row, set) { - assertEquals(g, this); + assert.equal(g, this); h_row = row; h_pts = pts; h_series = set; @@ -241,27 +241,27 @@ var runClosestTest = function(isStacked, widthNormal, widthHighlighted) { if (isStacked) { DygraphOps.dispatchMouseMove(g, 11.45, 1.4); - assertEquals(1, h_row); - assertEquals('c', h_series); + assert.equal(1, h_row); + assert.equal('c', h_series); //now move up in the same row DygraphOps.dispatchMouseMove(g, 11.45, 1.5); - assertEquals(1, h_row); - assertEquals('b', h_series); + assert.equal(1, h_row); + assert.equal('b', h_series); //and a bit to the right DygraphOps.dispatchMouseMove(g, 11.55, 1.5); - assertEquals(2, h_row); - assertEquals('c', h_series); + assert.equal(2, h_row); + assert.equal('c', h_series); } else { DygraphOps.dispatchMouseMove(g, 11, 1.5); - assertEquals(1, h_row); - assertEquals('c', h_series); + assert.equal(1, h_row); + assert.equal('c', h_series); //now move up in the same row DygraphOps.dispatchMouseMove(g, 11, 2.5); - assertEquals(1, h_row); - assertEquals('b', h_series); + assert.equal(1, h_row); + assert.equal('b', h_series); } return g; @@ -270,70 +270,70 @@ var runClosestTest = function(isStacked, widthNormal, widthHighlighted) { /** * Test basic closest-point highlighting. */ -CallbackTestCase.prototype.testClosestPointCallback = function() { +it('testClosestPointCallback', function() { runClosestTest(false, 1, 3); -} +}); /** * Test setSelection() with series name */ -CallbackTestCase.prototype.testSetSelection = function() { +it('testSetSelection', function() { var g = runClosestTest(false, 1, 3); - assertEquals(1, g.attr_('strokeWidth', 'c')); + assert.equal(1, g.attr_('strokeWidth', 'c')); g.setSelection(false, 'c'); - assertEquals(3, g.attr_('strokeWidth', 'c')); -} + assert.equal(3, g.attr_('strokeWidth', 'c')); +}); /** * Test closest-point highlighting for stacked graph */ -CallbackTestCase.prototype.testClosestPointStackedCallback = function() { +it('testClosestPointStackedCallback', function() { runClosestTest(true, 1, 3); -} +}); /** * Closest-point highlighting with legend CSS - border around active series. */ -CallbackTestCase.prototype.testClosestPointCallbackCss1 = function() { +it('testClosestPointCallbackCss1', function() { var css = "div.dygraph-legend > span { display: block; }\n" + "div.dygraph-legend > span.highlight { border: 1px solid grey; }\n"; styleSheet.innerHTML = css; runClosestTest(false, 2, 4); styleSheet.innerHTML = ''; -} +}); /** * Closest-point highlighting with legend CSS - show only closest series. */ -CallbackTestCase.prototype.testClosestPointCallbackCss2 = function() { +it('testClosestPointCallbackCss2', function() { var css = "div.dygraph-legend > span { display: none; }\n" + "div.dygraph-legend > span.highlight { display: inline; }\n"; styleSheet.innerHTML = css; runClosestTest(false, 10, 15); styleSheet.innerHTML = ''; // TODO(klausw): verify that the highlighted line is drawn on top? -} +}); /** * Closest-point highlighting with locked series. */ -CallbackTestCase.prototype.testSetSelectionLocking = function() { +it('testSetSelectionLocking', function() { var g = runClosestTest(false, 2, 4); // Default behavior, 'b' is closest DygraphOps.dispatchMouseMove(g, 11, 4); - assertEquals('b', g.getHighlightSeries()); + assert.equal('b', g.getHighlightSeries()); // Now lock selection to 'c' g.setSelection(false, 'c', true); DygraphOps.dispatchMouseMove(g, 11, 4); - assertEquals('c', g.getHighlightSeries()); + assert.equal('c', g.getHighlightSeries()); // Unlock, should be back to 'b' g.clearSelection(); DygraphOps.dispatchMouseMove(g, 11, 4); - assertEquals('b', g.getHighlightSeries()); -} + assert.equal('b', g.getHighlightSeries()); +}); /** * This tests that closest point searches work for data containing NaNs. @@ -341,7 +341,7 @@ CallbackTestCase.prototype.testSetSelectionLocking = function() { * It's intended to catch a regression where a NaN Y value confuses the * closest-point algorithm, treating it as closer as any previous point. */ -CallbackTestCase.prototype.testNaNData = function() { +it('testNaNData', function() { var dataNaN = [ [9, -1, NaN, NaN], [10, -1, 1, 2], @@ -354,7 +354,7 @@ CallbackTestCase.prototype.testNaNData = function() { var h_pts; var highlightCallback = function(e, x, pts, row) { - assertEquals(g, this); + assert.equal(g, this); h_row = row; h_pts = pts; }; @@ -371,25 +371,25 @@ CallbackTestCase.prototype.testNaNData = function() { DygraphOps.dispatchMouseMove(g, 10.1, 0.9); //check correct row is returned - assertEquals(1, h_row); + assert.equal(1, h_row); // Explicitly test closest point algorithms var dom = g.toDomCoords(10.1, 0.9); - assertEquals(1, g.findClosestRow(dom[0])); + assert.equal(1, g.findClosestRow(dom[0])); var res = g.findClosestPoint(dom[0], dom[1]); - assertEquals(1, res.row); - assertEquals('b', res.seriesName); + assert.equal(1, res.row); + assert.equal('b', res.seriesName); res = g.findStackedPoint(dom[0], dom[1]); - assertEquals(1, res.row); - assertEquals('c', res.seriesName); -}; + assert.equal(1, res.row); + assert.equal('c', res.seriesName); +}); /** * This tests that stacked point searches work for data containing NaNs. */ -CallbackTestCase.prototype.testNaNDataStack = function() { +it('testNaNDataStack', function() { var dataNaN = [ [9, -1, NaN, NaN], [10, -1, 1, 2], @@ -407,7 +407,7 @@ CallbackTestCase.prototype.testNaNDataStack = function() { var h_pts; var highlightCallback = function(e, x, pts, row) { - assertEquals(g, this); + assert.equal(g, this); h_row = row; h_pts = pts; }; @@ -425,40 +425,40 @@ CallbackTestCase.prototype.testNaNDataStack = function() { DygraphOps.dispatchMouseMove(g, 10.1, 0.9); //check correct row is returned - assertEquals(1, h_row); + assert.equal(1, h_row); // Explicitly test stacked point algorithm. var dom = g.toDomCoords(10.1, 0.9); var res = g.findStackedPoint(dom[0], dom[1]); - assertEquals(1, res.row); - assertEquals('c', res.seriesName); + assert.equal(1, res.row); + assert.equal('c', res.seriesName); // All-NaN area at left, should get no points. dom = g.toDomCoords(9.1, 0.9); res = g.findStackedPoint(dom[0], dom[1]); - assertEquals(0, res.row); - assertEquals(undefined, res.seriesName); + assert.equal(0, res.row); + assert.equal(undefined, res.seriesName); // First gap, get 'c' since it's non-NaN. dom = g.toDomCoords(12.1, 0.9); res = g.findStackedPoint(dom[0], dom[1]); - assertEquals(3, res.row); - assertEquals('c', res.seriesName); + assert.equal(3, res.row); + assert.equal('c', res.seriesName); // Second gap, get 'b' since 'c' is NaN. dom = g.toDomCoords(15.1, 0.9); res = g.findStackedPoint(dom[0], dom[1]); - assertEquals(6, res.row); - assertEquals('b', res.seriesName); + assert.equal(6, res.row); + assert.equal('b', res.seriesName); // Isolated points should work, finding series b in this case. dom = g.toDomCoords(15.9, 3.1); res = g.findStackedPoint(dom[0], dom[1]); - assertEquals(7, res.row); - assertEquals('b', res.seriesName); -}; + assert.equal(7, res.row); + assert.equal('b', res.seriesName); +}); -CallbackTestCase.prototype.testGapHighlight = function() { +it('testGapHighlight', function() { var dataGap = [ [1, null, 3], [2, 2, null], @@ -473,7 +473,7 @@ CallbackTestCase.prototype.testGapHighlight = function() { var h_pts; var highlightCallback = function(e, x, pts, row) { - assertEquals(g, this); + assert.equal(g, this); h_row = row; h_pts = pts; }; @@ -491,26 +491,26 @@ CallbackTestCase.prototype.testGapHighlight = function() { DygraphOps.dispatchMouseMove(g, 1.1, 10); //point from series B - assertEquals(0, h_row); - assertEquals(1, h_pts.length); - assertEquals(3, h_pts[0].yval); - assertEquals('B', h_pts[0].name); + assert.equal(0, h_row); + assert.equal(1, h_pts.length); + assert.equal(3, h_pts[0].yval); + assert.equal('B', h_pts[0].name); DygraphOps.dispatchMouseMove(g, 6.1, 10); // A is NaN at x=6 - assertEquals(1, h_pts.length); + assert.equal(1, h_pts.length); assert(isNaN(h_pts[0].yval)); - assertEquals('A', h_pts[0].name); + assert.equal('A', h_pts[0].name); DygraphOps.dispatchMouseMove(g, 8.1, 10); //point from series A - assertEquals(6, h_row); - assertEquals(1, h_pts.length); - assertEquals(8, h_pts[0].yval); - assertEquals('A', h_pts[0].name); -}; + assert.equal(6, h_row); + assert.equal(1, h_pts.length); + assert.equal(8, h_pts[0].yval); + assert.equal('A', h_pts[0].name); +}); -CallbackTestCase.prototype.testFailedResponse = function() { +it('testFailedResponse', function() { // Fake out the XMLHttpRequest so it doesn't do anything. XMLHttpRequest = function () {}; @@ -518,7 +518,7 @@ CallbackTestCase.prototype.testFailedResponse = function() { XMLHttpRequest.prototype.send = function () {}; var highlightCallback = function(e, x, pts, row) { - fail("should not reach here"); + throw "should not reach here"; }; var graph = document.getElementById("graph"); @@ -539,15 +539,15 @@ CallbackTestCase.prototype.testFailedResponse = function() { DygraphOps.dispatchMouseOut_Point(g, 800, 800); // This call should not throw an exception. - assertFalse("exception thrown during mouseout", failed); -}; + assert.isFalse("exception thrown during mouseout", failed); +}); // Regression test for http://code.google.com/p/dygraphs/issues/detail?id=355 -CallbackTestCase.prototype.testHighlightCallbackRow = function() { +it('testHighlightCallbackRow', function() { var highlightRow; var highlightCallback = function(e, x, pts, row) { - assertEquals(g, this); + assert.equal(g, this); highlightRow = row; }; @@ -568,35 +568,35 @@ CallbackTestCase.prototype.testHighlightCallbackRow = function() { // Mouse over each of the points DygraphOps.dispatchMouseOver_Point(g, 0, 0); DygraphOps.dispatchMouseMove_Point(g, 0, 0); - assertEquals(0, highlightRow); + assert.equal(0, highlightRow); DygraphOps.dispatchMouseMove_Point(g, 100, 0); - assertEquals(1, highlightRow); + assert.equal(1, highlightRow); DygraphOps.dispatchMouseMove_Point(g, 200, 0); - assertEquals(2, highlightRow); + assert.equal(2, highlightRow); DygraphOps.dispatchMouseMove_Point(g, 300, 0); - assertEquals(3, highlightRow); + assert.equal(3, highlightRow); DygraphOps.dispatchMouseMove_Point(g, 400, 0); - assertEquals(4, highlightRow); + assert.equal(4, highlightRow); // Now zoom and verify that the row numbers still refer to rows in the data // array. g.updateOptions({dateWindow: [2, 4]}); DygraphOps.dispatchMouseOver_Point(g, 0, 0); DygraphOps.dispatchMouseMove_Point(g, 0, 0); - assertEquals(2, highlightRow); - assertEquals('2: Y: 3 Z: 4', Util.getLegend()); -}; + assert.equal(2, highlightRow); + assert.equal('2: Y: 3 Z: 4', Util.getLegend()); +}); /** * Test that underlay callback is called even when there are no series, * and that the y axis ranges are not NaN. */ -CallbackTestCase.prototype.testUnderlayCallback_noSeries = function() { +it('testUnderlayCallback_noSeries', function() { var called = false; var yMin, yMax; var callback = function(canvas, area, g) { - assertEquals(g, this); + assert.equal(g, this); called = true; yMin = g.yAxisRange(0)[0]; yMax = g.yAxisRange(0)[1]; @@ -607,20 +607,20 @@ CallbackTestCase.prototype.testUnderlayCallback_noSeries = function() { underlayCallback: callback }); - assertTrue(called); - assertFalse(isNaN(yMin)); - assertFalse(isNaN(yMax)); -}; + assert.isTrue(called); + assert.isFalse(isNaN(yMin)); + assert.isFalse(isNaN(yMax)); +}); /** * Test that underlay callback receives the correct y-axis range. */ -CallbackTestCase.prototype.testUnderlayCallback_yAxisRange = function() { +it('testUnderlayCallback_yAxisRange', function() { var called = false; var yMin, yMax; var callback = function(canvas, area, g) { - assertEquals(g, this); + assert.equal(g, this); yMin = g.yAxisRange(0)[0]; yMax = g.yAxisRange(0)[1]; }; @@ -631,19 +631,19 @@ CallbackTestCase.prototype.testUnderlayCallback_yAxisRange = function() { underlayCallback: callback }); - assertEquals(0, yMin); - assertEquals(10, yMax); -}; + assert.equal(0, yMin); + assert.equal(10, yMax); +}); /** * Test that drawPointCallback is called for isolated points and correct idx for the point is returned. */ -CallbackTestCase.prototype.testDrawPointCallback_idx = function() { +it('testDrawPointCallback_idx', function() { var indices = []; var g; var callback = function(g, seriesName, canvasContext, cx, cy, color, pointSizeParam,idx) { - assertEquals(g, this); + assert.equal(g, this); indices.push(idx); Dygraph.Circles.DEFAULT.apply(this, arguments); }; @@ -661,8 +661,8 @@ CallbackTestCase.prototype.testDrawPointCallback_idx = function() { // Test that correct idx for isolated points are passed to the callback. g = new Dygraph(graph, testdata, graphOpts); - assertEquals(2, indices.length); - assertEquals([3, 5],indices); + assert.equal(2, indices.length); + assert.deepEqual([3, 5],indices); // Test that correct indices for isolated points + gap points are passed to the callback when // drawGapEdgePoints is set. This should add one point at the right @@ -670,8 +670,8 @@ CallbackTestCase.prototype.testDrawPointCallback_idx = function() { indices = []; // Reset for new test graphOpts.drawGapEdgePoints = true; g = new Dygraph(graph, testdata, graphOpts); - assertEquals(3, indices.length); - assertEquals([1, 3, 5],indices); + assert.equal(3, indices.length); + assert.deepEqual([1, 3, 5],indices); //Test that correct indices are passed to the callback when zoomed in. @@ -680,18 +680,18 @@ CallbackTestCase.prototype.testDrawPointCallback_idx = function() { graphOpts.drawPoints = true; testdata = [[10, 2], [11, 3], [12, 4], [13, 2], [14, 5], [15, 3]]; g = new Dygraph(graph, testdata, graphOpts); - assertEquals(3, indices.length); - assertEquals([2, 3, 4],indices); -}; + assert.equal(3, indices.length); + assert.deepEqual([2, 3, 4],indices); +}); /** * Test that the correct idx is returned for the point in the onHiglightCallback. */ -CallbackTestCase.prototype.testDrawHighlightPointCallback_idx = function() { +it('testDrawHighlightPointCallback_idx', function() { var idxToCheck = null; var drawHighlightPointCallback = function(g, seriesName, canvasContext, cx, cy, color, pointSizeParam,idx) { - assertEquals(g, this); + assert.equal(g, this); idxToCheck = idx; }; var testdata = [[1, 2], [2, 3], [3, NaN], [4, 2], [5, NaN], [6, 3]]; @@ -701,13 +701,15 @@ CallbackTestCase.prototype.testDrawHighlightPointCallback_idx = function() { drawHighlightPointCallback : drawHighlightPointCallback }); - assertNull(idxToCheck); + assert.isNull(idxToCheck); DygraphOps.dispatchMouseMove(g, 3, 0); // check that NaN point is not highlighted - assertNull(idxToCheck); + assert.isNull(idxToCheck); DygraphOps.dispatchMouseMove(g, 1, 2); // check that correct index is returned - assertEquals(0,idxToCheck); + assert.equal(0,idxToCheck); DygraphOps.dispatchMouseMove(g, 6, 3); - assertEquals(5,idxToCheck); -}; + assert.equal(5,idxToCheck); +}); + +}); diff --git a/auto_tests/tests/connect_separated_points.js b/auto_tests/tests/connect_separated_points.js index d18a7b1..c104299 100644 --- a/auto_tests/tests/connect_separated_points.js +++ b/auto_tests/tests/connect_separated_points.js @@ -3,26 +3,26 @@ * * @author julian.eichstaedt@ch.sauter-bc.com (Fr. Sauter AG) */ -var ConnectSeparatedPointsTestCase = TestCase("connect-separated-points"); +describe("connect-separated-points", function() { -ConnectSeparatedPointsTestCase.prototype.setUp = function() { +beforeEach(function() { document.body.innerHTML = "
"; -}; +}); var origFunc = Dygraph.getContext; -ConnectSeparatedPointsTestCase.prototype.setUp = function() { +beforeEach(function() { document.body.innerHTML = "
"; Dygraph.getContext = function(canvas) { return new Proxy(origFunc(canvas)); }; -}; +}); -ConnectSeparatedPointsTestCase.prototype.tearDown = function() { +afterEach(function() { Dygraph.getContext = origFunc; -}; +}); -ConnectSeparatedPointsTestCase.prototype.testEdgePointsSimple = function() { +it('testEdgePointsSimple', function() { var opts = { width: 480, height: 320, @@ -47,7 +47,7 @@ ConnectSeparatedPointsTestCase.prototype.testEdgePointsSimple = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - htx = g.hidden_ctx_; + var htx = g.hidden_ctx_; var attrs = {}; @@ -84,9 +84,9 @@ ConnectSeparatedPointsTestCase.prototype.testEdgePointsSimple = function() { // Check if both points are connected at the right edge of the canvas and if the option "connectSeparatedPoints" works properly // even if the point is outside the visible range and only one series has a valid value for this point. CanvasAssertions.assertLineDrawn(htx, xy1, xy2, attrs); -}; +}); -ConnectSeparatedPointsTestCase.prototype.testEdgePointsCustomBars = function() { +it('testEdgePointsCustomBars', function() { var opts = { width: 480, height: 320, @@ -113,7 +113,7 @@ ConnectSeparatedPointsTestCase.prototype.testEdgePointsCustomBars = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - htx = g.hidden_ctx_; + var htx = g.hidden_ctx_; var attrs = {}; @@ -213,9 +213,9 @@ ConnectSeparatedPointsTestCase.prototype.testEdgePointsCustomBars = function() { // Check if both points are connected at the right edge of the canvas and if the option "connectSeparatedPoints" works properly // even if the point is outside the visible range and only one series has a valid value for this point. CanvasAssertions.assertLineDrawn(htx, xy1, xy2, attrs); -}; +}); -ConnectSeparatedPointsTestCase.prototype.testEdgePointsErrorBars = function() { +it('testEdgePointsErrorBars', function() { var opts = { width: 480, height: 320, @@ -243,7 +243,7 @@ ConnectSeparatedPointsTestCase.prototype.testEdgePointsErrorBars = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - htx = g.hidden_ctx_; + var htx = g.hidden_ctx_; var attrs = {}; @@ -350,16 +350,16 @@ ConnectSeparatedPointsTestCase.prototype.testEdgePointsErrorBars = function() { // Check if both points are connected at the right edge of the canvas and if the option "connectSeparatedPoints" works properly // even if the point is outside the visible range and only one series has a valid value for this point. CanvasAssertions.assertLineDrawn(htx, xy1, xy2, attrs); -}; +}); -ConnectSeparatedPointsTestCase.prototype.testConnectSeparatedPointsPerSeries = function() { +it('testConnectSeparatedPointsPerSeries', function() { var assertExpectedLinesDrawnPerSeries = function(htx, expectedSeries1, expectedSeries2, expectedSeries3) { var expected = [expectedSeries1, expectedSeries2, expectedSeries3]; var actual = [ CanvasAssertions.numLinesDrawn(htx, "#ff0000"), CanvasAssertions.numLinesDrawn(htx, "#00ff00"), CanvasAssertions.numLinesDrawn(htx, "#0000ff")]; - assertEquals(expected, actual); + assert.equal(expected, actual); } var g = new Dygraph(document.getElementById("graph"), @@ -378,7 +378,7 @@ ConnectSeparatedPointsTestCase.prototype.testConnectSeparatedPointsPerSeries = f colors: ["#ff0000", "#00ff00", "#0000ff"] }); - htx = g.hidden_ctx_; + var htx = g.hidden_ctx_; assertExpectedLinesDrawnPerSeries(htx, 4, 1, 2); Proxy.reset(htx); @@ -405,9 +405,9 @@ ConnectSeparatedPointsTestCase.prototype.testConnectSeparatedPointsPerSeries = f } }); assertExpectedLinesDrawnPerSeries(htx, 4, 3, 3); -} +}); -ConnectSeparatedPointsTestCase.prototype.testNaNErrorBars = function() { +it('testNaNErrorBars', function() { var data = [ [0,[1,2,3]], [1,[2,3,4]], @@ -433,7 +433,7 @@ ConnectSeparatedPointsTestCase.prototype.testNaNErrorBars = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - htx = g.hidden_ctx_; + var htx = g.hidden_ctx_; var attrs = {}; @@ -445,5 +445,7 @@ ConnectSeparatedPointsTestCase.prototype.testNaNErrorBars = function() { // No line across the NaN gap, and a single line (not two) // across the null gap. - assertEquals(8, CanvasAssertions.numLinesDrawn(htx, '#ff0000')); -}; + assert.equal(8, CanvasAssertions.numLinesDrawn(htx, '#ff0000')); +}); + +}); diff --git a/auto_tests/tests/css.js b/auto_tests/tests/css.js index 9348f49..89a0680 100644 --- a/auto_tests/tests/css.js +++ b/auto_tests/tests/css.js @@ -4,36 +4,36 @@ * @fileoverview Regression test based on some strange customBars data. * @author danvk@google.com (Dan Vanderkam) */ -var CssTestCase = TestCase("css"); +describe("css", function() { var data = "X,Y,Z\n1,2,3\n4,5,6\n"; var styleSheet; -CssTestCase.prototype.setUp = function() { +beforeEach(function() { document.body.innerHTML = "
"; styleSheet = document.createElement("style"); styleSheet.type = "text/css"; document.getElementsByTagName("head")[0].appendChild(styleSheet); -}; +}); -CssTestCase.prototype.tearDown = function() { -}; +afterEach(function() { +}); // Verifies that an unstyled, unsized dygraph gets a default size. -CssTestCase.prototype.testDefaultSize = function() { +it('testDefaultSize', function() { var opts = { }; var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - assertEquals(480, graph.offsetWidth); - assertEquals(320, graph.offsetHeight); - assertEquals({width: 480, height: 320}, g.size()); -}; + assert.equal(480, graph.offsetWidth); + assert.equal(320, graph.offsetHeight); + assert.deepEqual({width: 480, height: 320}, g.size()); +}); // Verifies that the width/height parameters work. -CssTestCase.prototype.testExplicitParamSize = function() { +it('testExplicitParamSize', function() { var opts = { width: 640, height: 480 @@ -41,13 +41,13 @@ CssTestCase.prototype.testExplicitParamSize = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - assertEquals(640, graph.offsetWidth); - assertEquals(480, graph.offsetHeight); - assertEquals({width: 640, height: 480}, g.size()); -}; + assert.equal(640, graph.offsetWidth); + assert.equal(480, graph.offsetHeight); + assert.deepEqual({width: 640, height: 480}, g.size()); +}); // Verifies that setting a style on the div works. -CssTestCase.prototype.testExplicitStyleSize = function() { +it('testExplicitStyleSize', function() { var opts = { }; var graph = document.getElementById("graph"); @@ -55,13 +55,13 @@ CssTestCase.prototype.testExplicitStyleSize = function() { graph.style.height = '400px'; var g = new Dygraph(graph, data, opts); - assertEquals(600, graph.offsetWidth); - assertEquals(400, graph.offsetHeight); - assertEquals({width: 600, height: 400}, g.size()); -}; + assert.equal(600, graph.offsetWidth); + assert.equal(400, graph.offsetHeight); + assert.deepEqual({width: 600, height: 400}, g.size()); +}); // Verifies that CSS pixel styles on the div trump explicit parameters. -CssTestCase.prototype.testPixelStyleWins = function() { +it('testPixelStyleWins', function() { var opts = { width: 987, height: 654 @@ -71,13 +71,13 @@ CssTestCase.prototype.testPixelStyleWins = function() { graph.style.height = '400px'; var g = new Dygraph(graph, data, opts); - assertEquals(600, graph.offsetWidth); - assertEquals(400, graph.offsetHeight); - assertEquals({width: 600, height: 400}, g.size()); -}; + assert.equal(600, graph.offsetWidth); + assert.equal(400, graph.offsetHeight); + assert.deepEqual({width: 600, height: 400}, g.size()); +}); // Verifies that a CSS percentage size works. -CssTestCase.prototype.testPercentageSize = function() { +it('testPercentageSize', function() { document.body.innerHTML = '
' + '
'; @@ -88,13 +88,13 @@ CssTestCase.prototype.testPercentageSize = function() { graph.style.height = '50%'; var g = new Dygraph(graph, data, opts); - assertEquals(300, graph.offsetWidth); - assertEquals(200, graph.offsetHeight); - assertEquals({width: 300, height: 200}, g.size()); -}; + assert.equal(300, graph.offsetWidth); + assert.equal(200, graph.offsetHeight); + assert.deepEqual({width: 300, height: 200}, g.size()); +}); // Verifies that a CSS class size works. -CssTestCase.prototype.testClassPixelSize = function() { +it('testClassPixelSize', function() { styleSheet.innerHTML = '.chart { width: 456px; height: 345px; }'; var opts = { @@ -102,47 +102,47 @@ CssTestCase.prototype.testClassPixelSize = function() { var graph = document.getElementById("graph"); graph.className = "chart"; var g = new Dygraph(graph, data, opts); - assertEquals(456, graph.offsetWidth); - assertEquals(345, graph.offsetHeight); - assertEquals({width: 456, height: 345}, g.size()); -}; + assert.equal(456, graph.offsetWidth); + assert.equal(345, graph.offsetHeight); + assert.deepEqual({width: 456, height: 345}, g.size()); +}); // An invisible chart div shouldn't produce an error. -CssTestCase.prototype.testInvisibleChart = function() { +it('testInvisibleChart', function() { document.body.innerHTML = '
' + '
' + '
'; var graph = document.getElementById("graph"); - g = new Dygraph(graph, data, {}); -}; + new Dygraph(graph, data, {}); +}); // An invisible chart div shouldn't produce an error. -CssTestCase.prototype.testInvisibleChartDate = function() { +it('testInvisibleChartDate', function() { document.body.innerHTML = '
' + '
' + '
'; var graph = document.getElementById("graph"); - g = new Dygraph(graph, + new Dygraph(graph, "Date,Y\n" + "2010/01/01,100\n" + "2010/02/01,200\n" + "2010/03/01,300\n" + "2010/04/01,400\n" + "2010/05/01,300\n" + - "2010/06/01,100\n" - , {}); -}; + "2010/06/01,100\n", + {}); +}); // An invisible chart div that becomes visible. -CssTestCase.prototype.testInvisibleThenVisibleChart = function() { +it('testInvisibleThenVisibleChart', function() { document.body.innerHTML = ''; var graph = document.getElementById("graph"); - g = new Dygraph(graph, + var g = new Dygraph(graph, "Date,Y\n" + "2010/01/01,100\n" + "2010/02/01,200\n" + @@ -160,15 +160,15 @@ CssTestCase.prototype.testInvisibleThenVisibleChart = function() { // or visibility so we need to let it know ourselves. g.resize(); - assertEquals(640, graph.offsetWidth); - assertEquals(480, graph.offsetHeight); - assertEquals({width: 640, height: 480}, g.size()); -}; + assert.equal(640, graph.offsetWidth); + assert.equal(480, graph.offsetHeight); + assert.deepEqual({width: 640, height: 480}, g.size()); +}); // Verifies that a div resize gets picked up. /* this one isn't quite ready yet. -CssTestCase.prototype.testDivResize = function() { +it('testDivResize', function() { var opts = { }; var graph = document.getElementById("graph"); @@ -176,14 +176,16 @@ CssTestCase.prototype.testDivResize = function() { graph.style.height = '480px'; var g = new Dygraph(graph, data, opts); - assertEquals(640, graph.offsetWidth); - assertEquals(480, graph.offsetHeight); - assertEquals({width: 640, height: 480}, g.size()); + assert.equal(640, graph.offsetWidth); + assert.equal(480, graph.offsetHeight); + assert.deepEqual({width: 640, height: 480}, g.size()); graph.style.width = '650px'; graph.style.height = '490px'; - assertEquals(650, graph.offsetWidth); - assertEquals(490, graph.offsetHeight); - assertEquals({width: 650, height: 490}, g.size()); -}; + assert.equal(650, graph.offsetWidth); + assert.equal(490, graph.offsetHeight); + assert.deepEqual({width: 650, height: 490}, g.size()); +}); */ + +}); diff --git a/auto_tests/tests/custom_bars.js b/auto_tests/tests/custom_bars.js index 5b7fd4b..1107c9e 100644 --- a/auto_tests/tests/custom_bars.js +++ b/auto_tests/tests/custom_bars.js @@ -4,22 +4,22 @@ * @fileoverview Regression test based on some strange customBars data. * @author danvk@google.com (Dan Vanderkam) */ -var CustomBarsTestCase = TestCase("custom-bars"); +describe("custom-bars", function() { -_origFunc = Dygraph.getContext; -CustomBarsTestCase.prototype.setUp = function() { +var _origFunc = Dygraph.getContext; +beforeEach(function() { document.body.innerHTML = "
"; Dygraph.getContext = function(canvas) { return new Proxy(_origFunc(canvas)); } -}; +}); -CustomBarsTestCase.prototype.tearDown = function() { +afterEach(function() { Dygraph.getContext = _origFunc; -}; +}); // This test used to reliably produce an infinite loop. -CustomBarsTestCase.prototype.testCustomBarsNoHang = function() { +it('testCustomBarsNoHang', function() { var opts = { width: 480, height: 320, @@ -61,10 +61,10 @@ CustomBarsTestCase.prototype.testCustomBarsNoHang = function() { "35,,0;22437620;0\n"; var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); -}; +}); // Regression test for http://code.google.com/p/dygraphs/issues/detail?id=201 -CustomBarsTestCase.prototype.testCustomBarsZero = function() { +it('testCustomBarsZero', function() { var opts = { customBars: true }; @@ -77,12 +77,12 @@ CustomBarsTestCase.prototype.testCustomBarsZero = function() { var g = new Dygraph(graph, data, opts); var range = g.yAxisRange(); - assertTrue('y-axis must include 0', range[0] <= 0); - assertTrue('y-axis must include 5', range[1] >= 5); -}; + assert.isTrue('y-axis must include 0', range[0] <= 0); + assert.isTrue('y-axis must include 5', range[1] >= 5); +}); // Regression test for http://code.google.com/p/dygraphs/issues/detail?id=229 -CustomBarsTestCase.prototype.testCustomBarsAtTop = function() { +it('testCustomBarsAtTop', function() { var g = new Dygraph(document.getElementById("graph"), [ [1, [10, 10, 100]], @@ -115,11 +115,11 @@ CustomBarsTestCase.prototype.testCustomBarsAtTop = function() { }); var sampler = new PixelSampler(g); - assertEquals([0, 255, 0, 38], sampler.colorAtCoordinate(5, 60)); -}; + assert.deepEqual([0, 255, 0, 38], sampler.colorAtCoordinate(5, 60)); +}); // Tests that custom bars work with log scale. -CustomBarsTestCase.prototype.testCustomBarsLogScale = function() { +it('testCustomBarsLogScale', function() { var g = new Dygraph(document.getElementById("graph"), [ [1, [10, 10, 100]], @@ -162,10 +162,9 @@ CustomBarsTestCase.prototype.testCustomBarsLogScale = function() { [495, 181.66450704318103], [247.5, 152.02209814465604]], { fillStyle: "#00ff00" }); -}; +}); -CustomBarsTestCase.prototype.testCustomBarsWithNegativeValuesInLogScale = - function() { +it('testCustomBarsWithNegativeValuesInLogScale', function() { var graph = document.getElementById("graph"); var count = 0; @@ -186,10 +185,12 @@ CustomBarsTestCase.prototype.testCustomBarsWithNegativeValuesInLogScale = }); // Normally all three points would be drawn. - assertEquals(3, count); + assert.equal(3, count); count = 0; // In log scale, the third point shouldn't be shown. g.updateOptions({ logscale : true }); - assertEquals(2, count); -}; + assert.equal(2, count); +}); + +}); diff --git a/auto_tests/tests/data_api.js b/auto_tests/tests/data_api.js index 90c6ca5..4b0ebe0 100644 --- a/auto_tests/tests/data_api.js +++ b/auto_tests/tests/data_api.js @@ -3,11 +3,11 @@ * * @author danvdk@gmail.com (Dan Vanderkam) */ -var dataApiTestCase = TestCase("data-api"); +describe("data-api", function() { var opts, graphDiv; -dataApiTestCase.prototype.setUp = function() { +beforeEach(function() { document.body.innerHTML = "
"; opts = { width: 480, @@ -15,47 +15,47 @@ dataApiTestCase.prototype.setUp = function() { }; graphDiv = document.getElementById("graph"); -}; +}); -dataApiTestCase.prototype.tearDown = function() { -}; +afterEach(function() { +}); -dataApiTestCase.prototype.testBasicAccessors = function() { +it('testBasicAccessors', function() { var g = new Dygraph(graphDiv, temperature_data, opts); - assertEquals(365, g.numRows()); - assertEquals(3, g.numColumns()); + assert.equal(365, g.numRows()); + assert.equal(3, g.numColumns()); // 2007-01-01,62,39 - assertEquals(62, g.getValue(0, 1)); - assertEquals(39, g.getValue(0, 2)); + assert.equal(62, g.getValue(0, 1)); + assert.equal(39, g.getValue(0, 2)); // 2007-12-31,57,42 - assertEquals(57, g.getValue(364, 1)); - assertEquals(42, g.getValue(364, 2)); -}; + assert.equal(57, g.getValue(364, 1)); + assert.equal(42, g.getValue(364, 2)); +}); -dataApiTestCase.prototype.testAccessorsCustomBars = function() { +it('testAccessorsCustomBars', function() { var g = new Dygraph(graphDiv, data_temp_high_low, { customBars: true }); - assertEquals(1070, g.numRows()); - assertEquals(3, g.numColumns()); + assert.equal(1070, g.numRows()); + assert.equal(3, g.numColumns()); // 2007-01-01,46;51;56,43;45;48 - assertEquals([46, 51, 56], g.getValue(0, 1)); - assertEquals([43, 45, 48], g.getValue(0, 2)); + assert.deepEqual([46, 51, 56], g.getValue(0, 1)); + assert.deepEqual([43, 45, 48], g.getValue(0, 2)); // 2009-12-05,37;42;47 (i.e. missing second column) - assertEquals([37, 42, 47], g.getValue(1069, 1)); - assertEquals([null, null, null], g.getValue(1069, 2)); -}; + assert.deepEqual([37, 42, 47], g.getValue(1069, 1)); + assert.deepEqual([null, null, null], g.getValue(1069, 2)); +}); // Regression test for #554. -dataApiTestCase.prototype.testGetRowForX = function() { +it('testGetRowForX', function() { var g = new Dygraph(graphDiv, [ "x,y", "1,2", @@ -65,22 +65,22 @@ dataApiTestCase.prototype.testGetRowForX = function() { "9,10" ].join('\n'), opts); - assertEquals(null, g.getRowForX(0)); - assertEquals(0, g.getRowForX(1)); - assertEquals(null, g.getRowForX(2)); - assertEquals(1, g.getRowForX(3)); - assertEquals(null, g.getRowForX(4)); - assertEquals(2, g.getRowForX(5)); - assertEquals(null, g.getRowForX(6)); - assertEquals(3, g.getRowForX(7)); - assertEquals(null, g.getRowForX(8)); - assertEquals(4, g.getRowForX(9)); - assertEquals(null, g.getRowForX(10)); -}; + assert.equal(null, g.getRowForX(0)); + assert.equal(0, g.getRowForX(1)); + assert.equal(null, g.getRowForX(2)); + assert.equal(1, g.getRowForX(3)); + assert.equal(null, g.getRowForX(4)); + assert.equal(2, g.getRowForX(5)); + assert.equal(null, g.getRowForX(6)); + assert.equal(3, g.getRowForX(7)); + assert.equal(null, g.getRowForX(8)); + assert.equal(4, g.getRowForX(9)); + assert.equal(null, g.getRowForX(10)); +}); // If there are rows with identical x-values, getRowForX promises that it will // return the first one. -dataApiTestCase.prototype.testGetRowForXDuplicates = function() { +it('testGetRowForXDuplicates', function() { var g = new Dygraph(graphDiv, [ "x,y", "1,2", // 0 @@ -95,7 +95,9 @@ dataApiTestCase.prototype.testGetRowForXDuplicates = function() { "9,10" ].join('\n'), opts); - assertEquals(0, g.getRowForX(1)); - assertEquals(null, g.getRowForX(2)); - assertEquals(5, g.getRowForX(9)); -}; + assert.equal(0, g.getRowForX(1)); + assert.equal(null, g.getRowForX(2)); + assert.equal(5, g.getRowForX(9)); +}); + +}); diff --git a/auto_tests/tests/date_formats.js b/auto_tests/tests/date_formats.js index 05a62c6..d15567b 100644 --- a/auto_tests/tests/date_formats.js +++ b/auto_tests/tests/date_formats.js @@ -3,15 +3,15 @@ * * @author dan@dygraphs.com (Dan Vanderkam) */ -var dateFormatsTestCase = TestCase("date-formats"); +describe("date-formats", function() { -dateFormatsTestCase.prototype.setUp = function() { -}; +beforeEach(function() { +}); -dateFormatsTestCase.prototype.tearDown = function() { -}; +afterEach(function() { +}); -dateFormatsTestCase.prototype.testISO8601 = function() { +it('testISO8601', function() { // Format: YYYY-MM-DDTHH:MM:SS.ddddddZ // The "Z" indicates UTC, so this test should pass regardless of the time // zone of the machine on which it is run. @@ -19,11 +19,11 @@ dateFormatsTestCase.prototype.testISO8601 = function() { // Firefox <4 does not support this format: // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/parse if (navigator.userAgent.indexOf("Firefox/3.5") == -1) { - assertEquals(946816496789, Dygraph.dateParser("2000-01-02T12:34:56.789012Z")); + assert.equal(946816496789, Dygraph.dateParser("2000-01-02T12:34:56.789012Z")); } -}; +}); -dateFormatsTestCase.prototype.testHyphenatedDate = function() { +it('testHyphenatedDate', function() { // Format: YYYY-MM-DD HH:MM // Midnight February 2, 2000, UTC @@ -36,5 +36,7 @@ dateFormatsTestCase.prototype.testHyphenatedDate = function() { zp(d.getDate()) + ' ' + zp(d.getHours()) + ':' + zp(d.getMinutes()); - assertEquals(Date.UTC(2000, 1, 2), Dygraph.dateParser(str)); -}; + assert.equal(Date.UTC(2000, 1, 2), Dygraph.dateParser(str)); +}); + +}); diff --git a/auto_tests/tests/date_ticker.js b/auto_tests/tests/date_ticker.js index 7abcc0f..665a463 100644 --- a/auto_tests/tests/date_ticker.js +++ b/auto_tests/tests/date_ticker.js @@ -6,11 +6,11 @@ * @author danvdk@gmail.com (Dan Vanderkam) */ -var DateTickerTestCase = TestCase("date-ticker-tests"); +describe("date-ticker-tests", function() { -DateTickerTestCase.prototype.setUp = function() { +beforeEach(function() { document.body.innerHTML = "
"; -}; +}); var createOptionsViewForAxis = function(axis, dict) { return function (x) { @@ -37,7 +37,7 @@ function changeNbspToSpace(ticks) { } } -DateTickerTestCase.prototype.testBasicDateTicker = function() { +it('testBasicDateTicker', function() { var opts = {labelsUTC: true}; var options = createOptionsViewForAxis('x', opts); @@ -53,7 +53,7 @@ DateTickerTestCase.prototype.testBasicDateTicker = function() { {"v": 631152000000, "label":"1990"}, {"v": 946684800000, "label":"2000"} ]; - assertEquals(expected_ticks, ticks); + assert.equal(expected_ticks, ticks); var start = Date.UTC(1999, 11, 31, 14, 0, 0); var end = Date.UTC(2000, 0, 1, 12, 0, 0); @@ -74,10 +74,10 @@ DateTickerTestCase.prototype.testBasicDateTicker = function() { {v: Date.UTC(2000, 0, 1, 10, 0, 0), label: '10:00'}, {v: Date.UTC(2000, 0, 1, 12, 0, 0), label: '12:00'} ]; - assertEquals(expected_ticks, ticks); -}; + assert.equal(expected_ticks, ticks); +}); -DateTickerTestCase.prototype.testAllDateTickers = function() { +it('testAllDateTickers', function() { var opts = {labelsUTC: true, pixelsPerLabel: 60}; var options = createOptionsViewForAxis('x', opts); @@ -91,175 +91,177 @@ DateTickerTestCase.prototype.testAllDateTickers = function() { return ticks; }; - assertEquals([{"v":-1577923200000,"label":"1920"},{"v":-1262304000000,"label":"1930"},{"v":-946771200000,"label":"1940"},{"v":-631152000000,"label":"1950"},{"v":-315619200000,"label":"1960"},{"v":0,"label":"1970"},{"v":315532800000,"label":"1980"},{"v":631152000000,"label":"1990"},{"v":946684800000,"label":"2000"}], ticker(-1797552000000, 1255561200000, 800, options)); - assertEquals([{"v":-5364662400000,"label":"1800"},{"v":-2208988800000,"label":"1900"}], ticker(-6122044800000, 189302400000, 480, options)); - assertEquals([{"v":1041120000000,"label":"29 Dec"},{"v":1041724800000,"label":"05 Jan"},{"v":1042329600000,"label":"12 Jan"},{"v":1042934400000,"label":"19 Jan"},{"v":1043539200000,"label":"26 Jan"},{"v":1044144000000,"label":"02 Feb"},{"v":1044748800000,"label":"09 Feb"},{"v":1045353600000,"label":"16 Feb"}], ticker(1041120000000, 1045353600000, 640, options)); - assertEquals([{"v":1041379200000,"label":"Jan 2003"},{"v":1072915200000,"label":"Jan 2004"},{"v":1104537600000,"label":"Jan 2005"},{"v":1136073600000,"label":"Jan 2006"},{"v":1167609600000,"label":"Jan 2007"},{"v":1199145600000,"label":"Jan 2008"},{"v":1230768000000,"label":"Jan 2009"},{"v":1262304000000,"label":"Jan 2010"},{"v":1293840000000,"label":"Jan 2011"}], ticker(1041120000000, 1307833200000, 800, options)); - assertEquals([{"v":1159660800000,"label":"01 Oct"},{"v":1160265600000,"label":"08 Oct"},{"v":1160870400000,"label":"15 Oct"},{"v":1161475200000,"label":"22 Oct"},{"v":1162080000000,"label":"29 Oct"}], ticker(1159657200000, 1162252800000, 480, options)); - assertEquals([{"v":1159660800000,"label":"01 Oct"},{"v":1160265600000,"label":"08 Oct"},{"v":1160870400000,"label":"15 Oct"},{"v":1161475200000,"label":"22 Oct"},{"v":1162080000000,"label":"29 Oct"}], ticker(1159657200000, 1162252800000, 640, options)); - assertEquals([{"v":1159660800000,"label":"01 Oct"},{"v":1160265600000,"label":"08 Oct"},{"v":1160870400000,"label":"15 Oct"},{"v":1161475200000,"label":"22 Oct"},{"v":1162080000000,"label":"29 Oct"},{"v":1162684800000,"label":"05 Nov"},{"v":1163289600000,"label":"12 Nov"},{"v":1163894400000,"label":"19 Nov"},{"v":1164499200000,"label":"26 Nov"}], ticker(1159657200000, 1164758400000, 1150, options)); - assertEquals([{"v":1159660800000,"label":"Oct 2006"},{"v":1162339200000,"label":"Nov 2006"}], ticker(1159657200000, 1164758400000, 400, options)); - assertEquals([{"v":1159660800000,"label":"01 Oct"},{"v":1160265600000,"label":"08 Oct"},{"v":1160870400000,"label":"15 Oct"},{"v":1161475200000,"label":"22 Oct"},{"v":1162080000000,"label":"29 Oct"},{"v":1162684800000,"label":"05 Nov"},{"v":1163289600000,"label":"12 Nov"},{"v":1163894400000,"label":"19 Nov"},{"v":1164499200000,"label":"26 Nov"}], ticker(1159657200000, 1164758400000, 500, options)); - assertEquals([{"v":1159660800000,"label":"01 Oct"},{"v":1160265600000,"label":"08 Oct"},{"v":1160870400000,"label":"15 Oct"},{"v":1161475200000,"label":"22 Oct"},{"v":1162080000000,"label":"29 Oct"},{"v":1162684800000,"label":"05 Nov"},{"v":1163289600000,"label":"12 Nov"},{"v":1163894400000,"label":"19 Nov"},{"v":1164499200000,"label":"26 Nov"}], ticker(1159657200000, 1164758400000, 600, options)); - assertEquals([{"v":1160265600000,"label":"08 Oct"},{"v":1160870400000,"label":"15 Oct"},{"v":1161475200000,"label":"22 Oct"},{"v":1162080000000,"label":"29 Oct"},{"v":1162684800000,"label":"05 Nov"},{"v":1163289600000,"label":"12 Nov"}], ticker(1160243979962, 1163887694248, 600, options)); + assert.deepEqual([{"v":-1577923200000,"label":"1920"},{"v":-1262304000000,"label":"1930"},{"v":-946771200000,"label":"1940"},{"v":-631152000000,"label":"1950"},{"v":-315619200000,"label":"1960"},{"v":0,"label":"1970"},{"v":315532800000,"label":"1980"},{"v":631152000000,"label":"1990"},{"v":946684800000,"label":"2000"}], ticker(-1797552000000, 1255561200000, 800, options)); + assert.deepEqual([{"v":-5364662400000,"label":"1800"},{"v":-2208988800000,"label":"1900"}], ticker(-6122044800000, 189302400000, 480, options)); + assert.deepEqual([{"v":1041120000000,"label":"29 Dec"},{"v":1041724800000,"label":"05 Jan"},{"v":1042329600000,"label":"12 Jan"},{"v":1042934400000,"label":"19 Jan"},{"v":1043539200000,"label":"26 Jan"},{"v":1044144000000,"label":"02 Feb"},{"v":1044748800000,"label":"09 Feb"},{"v":1045353600000,"label":"16 Feb"}], ticker(1041120000000, 1045353600000, 640, options)); + assert.deepEqual([{"v":1041379200000,"label":"Jan 2003"},{"v":1072915200000,"label":"Jan 2004"},{"v":1104537600000,"label":"Jan 2005"},{"v":1136073600000,"label":"Jan 2006"},{"v":1167609600000,"label":"Jan 2007"},{"v":1199145600000,"label":"Jan 2008"},{"v":1230768000000,"label":"Jan 2009"},{"v":1262304000000,"label":"Jan 2010"},{"v":1293840000000,"label":"Jan 2011"}], ticker(1041120000000, 1307833200000, 800, options)); + assert.deepEqual([{"v":1159660800000,"label":"01 Oct"},{"v":1160265600000,"label":"08 Oct"},{"v":1160870400000,"label":"15 Oct"},{"v":1161475200000,"label":"22 Oct"},{"v":1162080000000,"label":"29 Oct"}], ticker(1159657200000, 1162252800000, 480, options)); + assert.deepEqual([{"v":1159660800000,"label":"01 Oct"},{"v":1160265600000,"label":"08 Oct"},{"v":1160870400000,"label":"15 Oct"},{"v":1161475200000,"label":"22 Oct"},{"v":1162080000000,"label":"29 Oct"}], ticker(1159657200000, 1162252800000, 640, options)); + assert.deepEqual([{"v":1159660800000,"label":"01 Oct"},{"v":1160265600000,"label":"08 Oct"},{"v":1160870400000,"label":"15 Oct"},{"v":1161475200000,"label":"22 Oct"},{"v":1162080000000,"label":"29 Oct"},{"v":1162684800000,"label":"05 Nov"},{"v":1163289600000,"label":"12 Nov"},{"v":1163894400000,"label":"19 Nov"},{"v":1164499200000,"label":"26 Nov"}], ticker(1159657200000, 1164758400000, 1150, options)); + assert.deepEqual([{"v":1159660800000,"label":"Oct 2006"},{"v":1162339200000,"label":"Nov 2006"}], ticker(1159657200000, 1164758400000, 400, options)); + assert.deepEqual([{"v":1159660800000,"label":"01 Oct"},{"v":1160265600000,"label":"08 Oct"},{"v":1160870400000,"label":"15 Oct"},{"v":1161475200000,"label":"22 Oct"},{"v":1162080000000,"label":"29 Oct"},{"v":1162684800000,"label":"05 Nov"},{"v":1163289600000,"label":"12 Nov"},{"v":1163894400000,"label":"19 Nov"},{"v":1164499200000,"label":"26 Nov"}], ticker(1159657200000, 1164758400000, 500, options)); + assert.deepEqual([{"v":1159660800000,"label":"01 Oct"},{"v":1160265600000,"label":"08 Oct"},{"v":1160870400000,"label":"15 Oct"},{"v":1161475200000,"label":"22 Oct"},{"v":1162080000000,"label":"29 Oct"},{"v":1162684800000,"label":"05 Nov"},{"v":1163289600000,"label":"12 Nov"},{"v":1163894400000,"label":"19 Nov"},{"v":1164499200000,"label":"26 Nov"}], ticker(1159657200000, 1164758400000, 600, options)); + assert.deepEqual([{"v":1160265600000,"label":"08 Oct"},{"v":1160870400000,"label":"15 Oct"},{"v":1161475200000,"label":"22 Oct"},{"v":1162080000000,"label":"29 Oct"},{"v":1162684800000,"label":"05 Nov"},{"v":1163289600000,"label":"12 Nov"}], ticker(1160243979962, 1163887694248, 600, options)); - assertEquals([{"v":1160611200000,"label":"12 Oct"},{"v":1160784000000,"label":"14 Oct"},{"v":1160956800000,"label":"16 Oct"},{"v":1161129600000,"label":"18 Oct"}], ticker(1160521200000, 1161298800000, 480, options)); - assertEquals([{"v":1161475200000,"label":"22 Oct"},{"v":1161561600000,"label":"23 Oct"},{"v":1161648000000,"label":"24 Oct"},{"v":1161734400000,"label":"25 Oct"},{"v":1161820800000,"label":"26 Oct"},{"v":1161907200000,"label":"27 Oct"},{"v":1161993600000,"label":"28 Oct"}], ticker(1161471164461, 1161994065957, 600, options)); - assertEquals([{"v":1161561600000,"label":"23 Oct"},{"v":1161583200000,"label":"06:00"},{"v":1161604800000,"label":"12:00"},{"v":1161626400000,"label":"18:00"}], ticker(1161557878860, 1161642991675, 600, options)); - assertEquals([{"v":1161756000000,"label":"06:00"},{"v":1161759600000,"label":"07:00"},{"v":1161763200000,"label":"08:00"},{"v":1161766800000,"label":"09:00"},{"v":1161770400000,"label":"10:00"},{"v":1161774000000,"label":"11:00"},{"v":1161777600000,"label":"12:00"}], ticker(1161752537840, 1161777663332, 600, options)); - assertEquals([{"v":1167609600000,"label":"01 Jan"},{"v":1167696000000,"label":"02 Jan"},{"v":1167782400000,"label":"03 Jan"},{"v":1167868800000,"label":"04 Jan"},{"v":1167955200000,"label":"05 Jan"},{"v":1168041600000,"label":"06 Jan"},{"v":1168128000000,"label":"07 Jan"},{"v":1168214400000,"label":"08 Jan"},{"v":1168300800000,"label":"09 Jan"}], ticker(1167609600000, 1168300800000, 480, options)); - assertEquals([{"v":1167609600000,"label":"Jan 2007"}], ticker(1167609600000, 1199059200000, 100, options)); - assertEquals([{"v":1167609600000,"label":"Jan 2007"},{"v":1175385600000,"label":"Apr 2007"},{"v":1183248000000,"label":"Jul 2007"},{"v":1191196800000,"label":"Oct 2007"}], ticker(1167609600000, 1199059200000, 300, options)); - assertEquals([{"v":1167609600000,"label":"Jan 2007"},{"v":1175385600000,"label":"Apr 2007"},{"v":1183248000000,"label":"Jul 2007"},{"v":1191196800000,"label":"Oct 2007"}], ticker(1167609600000, 1199059200000, 480, options)); - assertEquals([{"v":1167609600000,"label":"Jan 2007"},{"v":1175385600000,"label":"Apr 2007"},{"v":1183248000000,"label":"Jul 2007"},{"v":1191196800000,"label":"Oct 2007"}], ticker(1167609600000, 1199059200000, 600, options)); - assertEquals([{"v":1160611200000,"label":"12 Oct"},{"v":1160784000000,"label":"14 Oct"},{"v":1160956800000,"label":"16 Oct"},{"v":1161129600000,"label":"18 Oct"}], ticker(1160521200000, 1161298800000, 480, options)); - assertEquals([{"v":1167609600000,"label":"Jan 2007"},{"v":1170288000000,"label":"Feb 2007"},{"v":1172707200000,"label":"Mar 2007"},{"v":1175385600000,"label":"Apr 2007"},{"v":1177977600000,"label":"May 2007"},{"v":1180656000000,"label":"Jun 2007"},{"v":1183248000000,"label":"Jul 2007"},{"v":1185926400000,"label":"Aug 2007"},{"v":1188604800000,"label":"Sep 2007"},{"v":1191196800000,"label":"Oct 2007"},{"v":1193875200000,"label":"Nov 2007"},{"v":1196467200000,"label":"Dec 2007"}], ticker(1167609600000, 1199059200000, 800, options)); + assert.deepEqual([{"v":1160611200000,"label":"12 Oct"},{"v":1160784000000,"label":"14 Oct"},{"v":1160956800000,"label":"16 Oct"},{"v":1161129600000,"label":"18 Oct"}], ticker(1160521200000, 1161298800000, 480, options)); + assert.deepEqual([{"v":1161475200000,"label":"22 Oct"},{"v":1161561600000,"label":"23 Oct"},{"v":1161648000000,"label":"24 Oct"},{"v":1161734400000,"label":"25 Oct"},{"v":1161820800000,"label":"26 Oct"},{"v":1161907200000,"label":"27 Oct"},{"v":1161993600000,"label":"28 Oct"}], ticker(1161471164461, 1161994065957, 600, options)); + assert.deepEqual([{"v":1161561600000,"label":"23 Oct"},{"v":1161583200000,"label":"06:00"},{"v":1161604800000,"label":"12:00"},{"v":1161626400000,"label":"18:00"}], ticker(1161557878860, 1161642991675, 600, options)); + assert.deepEqual([{"v":1161756000000,"label":"06:00"},{"v":1161759600000,"label":"07:00"},{"v":1161763200000,"label":"08:00"},{"v":1161766800000,"label":"09:00"},{"v":1161770400000,"label":"10:00"},{"v":1161774000000,"label":"11:00"},{"v":1161777600000,"label":"12:00"}], ticker(1161752537840, 1161777663332, 600, options)); + assert.deepEqual([{"v":1167609600000,"label":"01 Jan"},{"v":1167696000000,"label":"02 Jan"},{"v":1167782400000,"label":"03 Jan"},{"v":1167868800000,"label":"04 Jan"},{"v":1167955200000,"label":"05 Jan"},{"v":1168041600000,"label":"06 Jan"},{"v":1168128000000,"label":"07 Jan"},{"v":1168214400000,"label":"08 Jan"},{"v":1168300800000,"label":"09 Jan"}], ticker(1167609600000, 1168300800000, 480, options)); + assert.deepEqual([{"v":1167609600000,"label":"Jan 2007"}], ticker(1167609600000, 1199059200000, 100, options)); + assert.deepEqual([{"v":1167609600000,"label":"Jan 2007"},{"v":1175385600000,"label":"Apr 2007"},{"v":1183248000000,"label":"Jul 2007"},{"v":1191196800000,"label":"Oct 2007"}], ticker(1167609600000, 1199059200000, 300, options)); + assert.deepEqual([{"v":1167609600000,"label":"Jan 2007"},{"v":1175385600000,"label":"Apr 2007"},{"v":1183248000000,"label":"Jul 2007"},{"v":1191196800000,"label":"Oct 2007"}], ticker(1167609600000, 1199059200000, 480, options)); + assert.deepEqual([{"v":1167609600000,"label":"Jan 2007"},{"v":1175385600000,"label":"Apr 2007"},{"v":1183248000000,"label":"Jul 2007"},{"v":1191196800000,"label":"Oct 2007"}], ticker(1167609600000, 1199059200000, 600, options)); + assert.deepEqual([{"v":1160611200000,"label":"12 Oct"},{"v":1160784000000,"label":"14 Oct"},{"v":1160956800000,"label":"16 Oct"},{"v":1161129600000,"label":"18 Oct"}], ticker(1160521200000, 1161298800000, 480, options)); + assert.deepEqual([{"v":1167609600000,"label":"Jan 2007"},{"v":1170288000000,"label":"Feb 2007"},{"v":1172707200000,"label":"Mar 2007"},{"v":1175385600000,"label":"Apr 2007"},{"v":1177977600000,"label":"May 2007"},{"v":1180656000000,"label":"Jun 2007"},{"v":1183248000000,"label":"Jul 2007"},{"v":1185926400000,"label":"Aug 2007"},{"v":1188604800000,"label":"Sep 2007"},{"v":1191196800000,"label":"Oct 2007"},{"v":1193875200000,"label":"Nov 2007"},{"v":1196467200000,"label":"Dec 2007"}], ticker(1167609600000, 1199059200000, 800, options)); - assertEquals([{"v":1293840000000,"label":"Jan 2011"},{"v":1296518400000,"label":"Feb 2011"},{"v":1298937600000,"label":"Mar 2011"},{"v":1301616000000,"label":"Apr 2011"},{"v":1304208000000,"label":"May 2011"},{"v":1306886400000,"label":"Jun 2011"},{"v":1309478400000,"label":"Jul 2011"},{"v":1312156800000,"label":"Aug 2011"}], ticker(1293753600000, 1312844400000, 727, options)); - assertEquals([{"v":1201824000000,"label":"01 Feb"},{"v":1201910400000,"label":"02 Feb"},{"v":1201996800000,"label":"03 Feb"},{"v":1202083200000,"label":"04 Feb"},{"v":1202169600000,"label":"05 Feb"},{"v":1202256000000,"label":"06 Feb"}], ticker(1201824000000, 1202256000000, 700, options)); - assertEquals([{"v":1210118400000,"label":"07 May"},{"v":1210140000000,"label":"06:00"},{"v":1210161600000,"label":"12:00"},{"v":1210183200000,"label":"18:00"},{"v":1210204800000,"label":"08 May"},{"v":1210226400000,"label":"06:00"},{"v":1210248000000,"label":"12:00"},{"v":1210269600000,"label":"18:00"},{"v":1210291200000,"label":"09 May"}], ticker(1210114800000, 1210291200000, 480, options)); - assertEquals([{"v":1210118400000,"label":"07 May"},{"v":1210204800000,"label":"08 May"},{"v":1210291200000,"label":"09 May"},{"v":1210377600000,"label":"10 May"},{"v":1210464000000,"label":"11 May"}], ticker(1210114800000, 1210464000000, 480, options)); - assertEquals([{"v":1210118400000,"label":"07 May"},{"v":1210204800000,"label":"08 May"},{"v":1210291200000,"label":"09 May"},{"v":1210377600000,"label":"10 May"},{"v":1210464000000,"label":"11 May"},{"v":1210550400000,"label":"12 May"}], ticker(1210114800000, 1210550400000, 480, options)); - assertEquals([{"v":1214870400000,"label":"01 Jul"},{"v":1214872200000,"label":"00:30"},{"v":1214874000000,"label":"01:00"},{"v":1214875800000,"label":"01:30"}], ticker(1214870400000, 1214877599000, 600, options)); - assertEquals([{"v":1214870400000,"label":"Jul 2008"},{"v":1217548800000,"label":"Aug 2008"},{"v":1220227200000,"label":"Sep 2008"}], ticker(1214866800000, 1222747200000, 600, options)); - assertEquals([{"v":1215820800000,"label":"12 Jul"},{"v":1215842400000,"label":"06:00"},{"v":1215864000000,"label":"12:00"},{"v":1215885600000,"label":"18:00"},{"v":1215907200000,"label":"13 Jul"},{"v":1215928800000,"label":"06:00"},{"v":1215950400000,"label":"12:00"},{"v":1215972000000,"label":"18:00"}], ticker(1215817200000, 1215989940000, 600, options)); - assertEquals([{"v":1246752000000,"label":"05 Jul"},{"v":1247356800000,"label":"12 Jul"},{"v":1247961600000,"label":"19 Jul"}], ticker(1246402800000, 1248217200000, 600, options)); - assertEquals([{"v":1246752000000,"label":"05 Jul"},{"v":1247356800000,"label":"12 Jul"},{"v":1247961600000,"label":"19 Jul"},{"v":1248566400000,"label":"26 Jul"},{"v":1249171200000,"label":"02 Aug"}], ticker(1246402800000, 1249340400000, 600, options)); - assertEquals([{"v":1247356800000,"label":"12 Jul"},{"v":1247360400000,"label":"01:00"},{"v":1247364000000,"label":"02:00"},{"v":1247367600000,"label":"03:00"},{"v":1247371200000,"label":"04:00"},{"v":1247374800000,"label":"05:00"},{"v":1247378400000,"label":"06:00"}], ticker(1247356800000, 1247378400000, 600, options)); + assert.deepEqual([{"v":1293840000000,"label":"Jan 2011"},{"v":1296518400000,"label":"Feb 2011"},{"v":1298937600000,"label":"Mar 2011"},{"v":1301616000000,"label":"Apr 2011"},{"v":1304208000000,"label":"May 2011"},{"v":1306886400000,"label":"Jun 2011"},{"v":1309478400000,"label":"Jul 2011"},{"v":1312156800000,"label":"Aug 2011"}], ticker(1293753600000, 1312844400000, 727, options)); + assert.deepEqual([{"v":1201824000000,"label":"01 Feb"},{"v":1201910400000,"label":"02 Feb"},{"v":1201996800000,"label":"03 Feb"},{"v":1202083200000,"label":"04 Feb"},{"v":1202169600000,"label":"05 Feb"},{"v":1202256000000,"label":"06 Feb"}], ticker(1201824000000, 1202256000000, 700, options)); + assert.deepEqual([{"v":1210118400000,"label":"07 May"},{"v":1210140000000,"label":"06:00"},{"v":1210161600000,"label":"12:00"},{"v":1210183200000,"label":"18:00"},{"v":1210204800000,"label":"08 May"},{"v":1210226400000,"label":"06:00"},{"v":1210248000000,"label":"12:00"},{"v":1210269600000,"label":"18:00"},{"v":1210291200000,"label":"09 May"}], ticker(1210114800000, 1210291200000, 480, options)); + assert.deepEqual([{"v":1210118400000,"label":"07 May"},{"v":1210204800000,"label":"08 May"},{"v":1210291200000,"label":"09 May"},{"v":1210377600000,"label":"10 May"},{"v":1210464000000,"label":"11 May"}], ticker(1210114800000, 1210464000000, 480, options)); + assert.deepEqual([{"v":1210118400000,"label":"07 May"},{"v":1210204800000,"label":"08 May"},{"v":1210291200000,"label":"09 May"},{"v":1210377600000,"label":"10 May"},{"v":1210464000000,"label":"11 May"},{"v":1210550400000,"label":"12 May"}], ticker(1210114800000, 1210550400000, 480, options)); + assert.deepEqual([{"v":1214870400000,"label":"01 Jul"},{"v":1214872200000,"label":"00:30"},{"v":1214874000000,"label":"01:00"},{"v":1214875800000,"label":"01:30"}], ticker(1214870400000, 1214877599000, 600, options)); + assert.deepEqual([{"v":1214870400000,"label":"Jul 2008"},{"v":1217548800000,"label":"Aug 2008"},{"v":1220227200000,"label":"Sep 2008"}], ticker(1214866800000, 1222747200000, 600, options)); + assert.deepEqual([{"v":1215820800000,"label":"12 Jul"},{"v":1215842400000,"label":"06:00"},{"v":1215864000000,"label":"12:00"},{"v":1215885600000,"label":"18:00"},{"v":1215907200000,"label":"13 Jul"},{"v":1215928800000,"label":"06:00"},{"v":1215950400000,"label":"12:00"},{"v":1215972000000,"label":"18:00"}], ticker(1215817200000, 1215989940000, 600, options)); + assert.deepEqual([{"v":1246752000000,"label":"05 Jul"},{"v":1247356800000,"label":"12 Jul"},{"v":1247961600000,"label":"19 Jul"}], ticker(1246402800000, 1248217200000, 600, options)); + assert.deepEqual([{"v":1246752000000,"label":"05 Jul"},{"v":1247356800000,"label":"12 Jul"},{"v":1247961600000,"label":"19 Jul"},{"v":1248566400000,"label":"26 Jul"},{"v":1249171200000,"label":"02 Aug"}], ticker(1246402800000, 1249340400000, 600, options)); + assert.deepEqual([{"v":1247356800000,"label":"12 Jul"},{"v":1247360400000,"label":"01:00"},{"v":1247364000000,"label":"02:00"},{"v":1247367600000,"label":"03:00"},{"v":1247371200000,"label":"04:00"},{"v":1247374800000,"label":"05:00"},{"v":1247378400000,"label":"06:00"}], ticker(1247356800000, 1247378400000, 600, options)); - assertEquals([{"v":1247356800000,"label":"12 Jul"},{"v":1247360400000,"label":"01:00"},{"v":1247364000000,"label":"02:00"},{"v":1247367600000,"label":"03:00"},{"v":1247371200000,"label":"04:00"},{"v":1247374800000,"label":"05:00"},{"v":1247378400000,"label":"06:00"}], ticker(1247356800000, 1247378400000, 600, options)); - assertEquals([{"v":1254268800000,"label":"30 Sep"},{"v":1254355200000,"label":"01 Oct"},{"v":1254441600000,"label":"02 Oct"},{"v":1254528000000,"label":"03 Oct"},{"v":1254614400000,"label":"04 Oct"},{"v":1254700800000,"label":"05 Oct"},{"v":1254787200000,"label":"06 Oct"},{"v":1254873600000,"label":"07 Oct"},{"v":1254960000000,"label":"08 Oct"},{"v":1255046400000,"label":"09 Oct"},{"v":1255132800000,"label":"10 Oct"}], ticker(1254222000000, 1255172400000, 900, options)); - assertEquals([{"v":1254441600000,"label":"02 Oct"},{"v":1254528000000,"label":"03 Oct"},{"v":1254614400000,"label":"04 Oct"},{"v":1254700800000,"label":"05 Oct"},{"v":1254787200000,"label":"06 Oct"},{"v":1254873600000,"label":"07 Oct"},{"v":1254960000000,"label":"08 Oct"}], ticker(1254394800000, 1254999600000, 900, options)); - assertEquals([{"v":1259625600000,"label":"01 Dec"},{"v":1259712000000,"label":"02 Dec"},{"v":1259798400000,"label":"03 Dec"},{"v":1259884800000,"label":"04 Dec"},{"v":1259971200000,"label":"05 Dec"},{"v":1260057600000,"label":"06 Dec"},{"v":1260144000000,"label":"07 Dec"}], ticker(1259625600000, 1260144000000, 480, options)); - assertEquals([{"v":1259625600000,"label":"01 Dec"},{"v":1259712000000,"label":"02 Dec"},{"v":1259798400000,"label":"03 Dec"},{"v":1259884800000,"label":"04 Dec"},{"v":1259971200000,"label":"05 Dec"},{"v":1260057600000,"label":"06 Dec"},{"v":1260144000000,"label":"07 Dec"}], ticker(1259625600000, 1260144000000, 600, options)); - assertEquals([{"v":1260057600000,"label":"06 Dec"},{"v":1260662400000,"label":"13 Dec"},{"v":1261267200000,"label":"20 Dec"},{"v":1261872000000,"label":"27 Dec"},{"v":1262476800000,"label":"03 Jan"},{"v":1263081600000,"label":"10 Jan"},{"v":1263686400000,"label":"17 Jan"},{"v":1264291200000,"label":"24 Jan"}], ticker(1260057600000, 1264291200000, 640, options)); - assertEquals([{"v":1262304000000,"label":"Jan 2010"},{"v":1264982400000,"label":"Feb 2010"},{"v":1267401600000,"label":"Mar 2010"},{"v":1270080000000,"label":"Apr 2010"}], ticker(1262304000000, 1270857600000, 640, options)); - assertEquals([{"v":1288915200000,"label":"05 Nov"},{"v":1288936800000,"label":"06:00"},{"v":1288958400000,"label":"12:00"},{"v":1288980000000,"label":"18:00"},{"v":1289001600000,"label":"06 Nov"},{"v":1289023200000,"label":"06:00"},{"v":1289044800000,"label":"12:00"},{"v":1289066400000,"label":"18:00"},{"v":1289088000000,"label":"07 Nov"},{"v":1289109600000,"label":"06:00"},{"v":1289131200000,"label":"12:00"},{"v":1289152800000,"label":"18:00"},{"v":1289174400000,"label":"08 Nov"},{"v":1289196000000,"label":"06:00"},{"v":1289217600000,"label":"12:00"},{"v":1289239200000,"label":"18:00"},{"v":1289260800000,"label":"09 Nov"}], ticker(1288911600000, 1289260800000, 1024, options)); - assertEquals([{"v":1291161600000,"label":"01 Dec"},{"v":1291248000000,"label":"02 Dec"},{"v":1291334400000,"label":"03 Dec"},{"v":1291420800000,"label":"04 Dec"},{"v":1291507200000,"label":"05 Dec"},{"v":1291593600000,"label":"06 Dec"},{"v":1291680000000,"label":"07 Dec"},{"v":1291766400000,"label":"08 Dec"},{"v":1291852800000,"label":"09 Dec"}], ticker(1291161600000, 1291852800000, 600, options)); - assertEquals([{"v":1294358400000,"label":"07 Jan"},{"v":1294444800000,"label":"08 Jan"},{"v":1294531200000,"label":"09 Jan"},{"v":1294617600000,"label":"10 Jan"},{"v":1294704000000,"label":"11 Jan"},{"v":1294790400000,"label":"12 Jan"},{"v":1294876800000,"label":"13 Jan"},{"v":1294963200000,"label":"14 Jan"}], ticker(1294358400000, 1294963200000, 480, options)); - assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"}], ticker(1307908000112, 1307908050165, 800, options)); - assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"}], ticker(1307908000112, 1307908051166, 800, options)); - assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"}], ticker(1307908000112, 1307908052167, 800, options)); - assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"}], ticker(1307908000112, 1307908053167, 800, options)); - assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"}], ticker(1307908000112, 1307908054168, 800, options)); - assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"}], ticker(1307908000112, 1307908055169, 800, options)); - assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"}], ticker(1307908000112, 1307908056169, 800, options)); - assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"}], ticker(1307908000112, 1307908057170, 800, options)); - assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"}], ticker(1307908000112, 1307908058171, 800, options)); - assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"}], ticker(1307908000112, 1307908059172, 800, options)); - assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"},{"v":1307908060000,"label":"19:47:40"}], ticker(1307908000112, 1307908060172, 800, options)); - assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"},{"v":1307908060000,"label":"19:47:40"}], ticker(1307908000112, 1307908061174, 800, options)); - assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"},{"v":1307908060000,"label":"19:47:40"}], ticker(1307908000112, 1307908062176, 800, options)); - assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"},{"v":1307908060000,"label":"19:47:40"}], ticker(1307908000112, 1307908063177, 800, options)); - assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"},{"v":1307908060000,"label":"19:47:40"}], ticker(1307908000112, 1307908064178, 800, options)); - assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908065000,"label":"19:47:45"}], ticker(1307908000112, 1307908065178, 800, options)); - assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908065000,"label":"19:47:45"}], ticker(1307908000112, 1307908066178, 800, options)); - assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908065000,"label":"19:47:45"}], ticker(1307908000112, 1307908067179, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"}], ticker(1307908000112, 1307908068179, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"}], ticker(1307908000112, 1307908069179, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908070180, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908071180, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908072181, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908073181, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908074182, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908075182, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908076183, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908077183, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908078184, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908079185, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908080186, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908081187, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908082188, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908083188, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908084189, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908085190, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908086191, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908087192, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908088192, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908089193, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908090194, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908091194, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908092196, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908093196, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908094197, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908095197, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908096198, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908097199, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908098200, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908099200, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908100201, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908101201, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908102202, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908103203, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908104204, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908105205, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908106205, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908107206, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908108209, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908109209, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908110209, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908111210, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908112211, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908113211, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908114212, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908115213, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908116214, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908117214, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908118215, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908119215, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908120217, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908121218, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908122219, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908123219, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908124220, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908125221, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908126222, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908127222, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908128223, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908129223, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"},{"v":1307908130000,"label":"19:48:50"}], ticker(1307908000112, 1307908130224, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"},{"v":1307908130000,"label":"19:48:50"}], ticker(1307908000112, 1307908131225, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"},{"v":1307908130000,"label":"19:48:50"}], ticker(1307908000112, 1307908132226, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"},{"v":1307908130000,"label":"19:48:50"}], ticker(1307908000112, 1307908133227, 800, options)); - assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"},{"v":1307908130000,"label":"19:48:50"}], ticker(1307908000112, 1307908134227, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908135227, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908136228, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908137230, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908138231, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908139232, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908140233, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908141233, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908142234, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908143240, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908144240, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908145240, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908146241, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908147241, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908148242, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908149243, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908150243, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908151244, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908152245, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908153245, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908154246, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908155247, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908156247, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908157248, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908158249, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908159250, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908160251, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908161252, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908162252, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908163253, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908164254, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908165254, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908166255, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908167256, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908168256, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908169257, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"},{"v":1307908170000,"label":"19:49:30"}], ticker(1307908000112, 1307908170258, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"},{"v":1307908170000,"label":"19:49:30"}], ticker(1307908000112, 1307908171258, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"},{"v":1307908170000,"label":"19:49:30"}], ticker(1307908000112, 1307908172259, 800, options)); - assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"},{"v":1307908170000,"label":"19:49:30"}], ticker(1307908000112, 1307908173260, 800, options)); - assertEquals([{"v":978307200000,"label":"Jan 2001"},{"v":986083200000,"label":"Apr 2001"},{"v":993945600000,"label":"Jul 2001"},{"v":1001894400000,"label":"Oct 2001"}], ticker(978307200000, 1001894400000, 400, options)); -}; + assert.deepEqual([{"v":1247356800000,"label":"12 Jul"},{"v":1247360400000,"label":"01:00"},{"v":1247364000000,"label":"02:00"},{"v":1247367600000,"label":"03:00"},{"v":1247371200000,"label":"04:00"},{"v":1247374800000,"label":"05:00"},{"v":1247378400000,"label":"06:00"}], ticker(1247356800000, 1247378400000, 600, options)); + assert.deepEqual([{"v":1254268800000,"label":"30 Sep"},{"v":1254355200000,"label":"01 Oct"},{"v":1254441600000,"label":"02 Oct"},{"v":1254528000000,"label":"03 Oct"},{"v":1254614400000,"label":"04 Oct"},{"v":1254700800000,"label":"05 Oct"},{"v":1254787200000,"label":"06 Oct"},{"v":1254873600000,"label":"07 Oct"},{"v":1254960000000,"label":"08 Oct"},{"v":1255046400000,"label":"09 Oct"},{"v":1255132800000,"label":"10 Oct"}], ticker(1254222000000, 1255172400000, 900, options)); + assert.deepEqual([{"v":1254441600000,"label":"02 Oct"},{"v":1254528000000,"label":"03 Oct"},{"v":1254614400000,"label":"04 Oct"},{"v":1254700800000,"label":"05 Oct"},{"v":1254787200000,"label":"06 Oct"},{"v":1254873600000,"label":"07 Oct"},{"v":1254960000000,"label":"08 Oct"}], ticker(1254394800000, 1254999600000, 900, options)); + assert.deepEqual([{"v":1259625600000,"label":"01 Dec"},{"v":1259712000000,"label":"02 Dec"},{"v":1259798400000,"label":"03 Dec"},{"v":1259884800000,"label":"04 Dec"},{"v":1259971200000,"label":"05 Dec"},{"v":1260057600000,"label":"06 Dec"},{"v":1260144000000,"label":"07 Dec"}], ticker(1259625600000, 1260144000000, 480, options)); + assert.deepEqual([{"v":1259625600000,"label":"01 Dec"},{"v":1259712000000,"label":"02 Dec"},{"v":1259798400000,"label":"03 Dec"},{"v":1259884800000,"label":"04 Dec"},{"v":1259971200000,"label":"05 Dec"},{"v":1260057600000,"label":"06 Dec"},{"v":1260144000000,"label":"07 Dec"}], ticker(1259625600000, 1260144000000, 600, options)); + assert.deepEqual([{"v":1260057600000,"label":"06 Dec"},{"v":1260662400000,"label":"13 Dec"},{"v":1261267200000,"label":"20 Dec"},{"v":1261872000000,"label":"27 Dec"},{"v":1262476800000,"label":"03 Jan"},{"v":1263081600000,"label":"10 Jan"},{"v":1263686400000,"label":"17 Jan"},{"v":1264291200000,"label":"24 Jan"}], ticker(1260057600000, 1264291200000, 640, options)); + assert.deepEqual([{"v":1262304000000,"label":"Jan 2010"},{"v":1264982400000,"label":"Feb 2010"},{"v":1267401600000,"label":"Mar 2010"},{"v":1270080000000,"label":"Apr 2010"}], ticker(1262304000000, 1270857600000, 640, options)); + assert.deepEqual([{"v":1288915200000,"label":"05 Nov"},{"v":1288936800000,"label":"06:00"},{"v":1288958400000,"label":"12:00"},{"v":1288980000000,"label":"18:00"},{"v":1289001600000,"label":"06 Nov"},{"v":1289023200000,"label":"06:00"},{"v":1289044800000,"label":"12:00"},{"v":1289066400000,"label":"18:00"},{"v":1289088000000,"label":"07 Nov"},{"v":1289109600000,"label":"06:00"},{"v":1289131200000,"label":"12:00"},{"v":1289152800000,"label":"18:00"},{"v":1289174400000,"label":"08 Nov"},{"v":1289196000000,"label":"06:00"},{"v":1289217600000,"label":"12:00"},{"v":1289239200000,"label":"18:00"},{"v":1289260800000,"label":"09 Nov"}], ticker(1288911600000, 1289260800000, 1024, options)); + assert.deepEqual([{"v":1291161600000,"label":"01 Dec"},{"v":1291248000000,"label":"02 Dec"},{"v":1291334400000,"label":"03 Dec"},{"v":1291420800000,"label":"04 Dec"},{"v":1291507200000,"label":"05 Dec"},{"v":1291593600000,"label":"06 Dec"},{"v":1291680000000,"label":"07 Dec"},{"v":1291766400000,"label":"08 Dec"},{"v":1291852800000,"label":"09 Dec"}], ticker(1291161600000, 1291852800000, 600, options)); + assert.deepEqual([{"v":1294358400000,"label":"07 Jan"},{"v":1294444800000,"label":"08 Jan"},{"v":1294531200000,"label":"09 Jan"},{"v":1294617600000,"label":"10 Jan"},{"v":1294704000000,"label":"11 Jan"},{"v":1294790400000,"label":"12 Jan"},{"v":1294876800000,"label":"13 Jan"},{"v":1294963200000,"label":"14 Jan"}], ticker(1294358400000, 1294963200000, 480, options)); + assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"}], ticker(1307908000112, 1307908050165, 800, options)); + assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"}], ticker(1307908000112, 1307908051166, 800, options)); + assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"}], ticker(1307908000112, 1307908052167, 800, options)); + assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"}], ticker(1307908000112, 1307908053167, 800, options)); + assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"}], ticker(1307908000112, 1307908054168, 800, options)); + assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"}], ticker(1307908000112, 1307908055169, 800, options)); + assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"}], ticker(1307908000112, 1307908056169, 800, options)); + assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"}], ticker(1307908000112, 1307908057170, 800, options)); + assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"}], ticker(1307908000112, 1307908058171, 800, options)); + assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"}], ticker(1307908000112, 1307908059172, 800, options)); + assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"},{"v":1307908060000,"label":"19:47:40"}], ticker(1307908000112, 1307908060172, 800, options)); + assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"},{"v":1307908060000,"label":"19:47:40"}], ticker(1307908000112, 1307908061174, 800, options)); + assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"},{"v":1307908060000,"label":"19:47:40"}], ticker(1307908000112, 1307908062176, 800, options)); + assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"},{"v":1307908060000,"label":"19:47:40"}], ticker(1307908000112, 1307908063177, 800, options)); + assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"},{"v":1307908060000,"label":"19:47:40"}], ticker(1307908000112, 1307908064178, 800, options)); + assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908065000,"label":"19:47:45"}], ticker(1307908000112, 1307908065178, 800, options)); + assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908065000,"label":"19:47:45"}], ticker(1307908000112, 1307908066178, 800, options)); + assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908065000,"label":"19:47:45"}], ticker(1307908000112, 1307908067179, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"}], ticker(1307908000112, 1307908068179, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"}], ticker(1307908000112, 1307908069179, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908070180, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908071180, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908072181, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908073181, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908074182, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908075182, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908076183, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908077183, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908078184, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908079185, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908080186, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908081187, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908082188, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908083188, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908084189, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908085190, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908086191, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908087192, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908088192, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908089193, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908090194, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908091194, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908092196, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908093196, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908094197, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908095197, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908096198, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908097199, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908098200, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908099200, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908100201, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908101201, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908102202, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908103203, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908104204, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908105205, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908106205, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908107206, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908108209, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908109209, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908110209, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908111210, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908112211, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908113211, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908114212, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908115213, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908116214, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908117214, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908118215, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908119215, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908120217, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908121218, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908122219, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908123219, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908124220, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908125221, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908126222, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908127222, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908128223, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908129223, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"},{"v":1307908130000,"label":"19:48:50"}], ticker(1307908000112, 1307908130224, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"},{"v":1307908130000,"label":"19:48:50"}], ticker(1307908000112, 1307908131225, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"},{"v":1307908130000,"label":"19:48:50"}], ticker(1307908000112, 1307908132226, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"},{"v":1307908130000,"label":"19:48:50"}], ticker(1307908000112, 1307908133227, 800, options)); + assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"},{"v":1307908130000,"label":"19:48:50"}], ticker(1307908000112, 1307908134227, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908135227, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908136228, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908137230, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908138231, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908139232, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908140233, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908141233, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908142234, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908143240, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908144240, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908145240, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908146241, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908147241, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908148242, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908149243, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908150243, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908151244, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908152245, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908153245, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908154246, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908155247, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908156247, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908157248, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908158249, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908159250, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908160251, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908161252, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908162252, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908163253, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908164254, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908165254, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908166255, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908167256, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908168256, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908169257, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"},{"v":1307908170000,"label":"19:49:30"}], ticker(1307908000112, 1307908170258, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"},{"v":1307908170000,"label":"19:49:30"}], ticker(1307908000112, 1307908171258, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"},{"v":1307908170000,"label":"19:49:30"}], ticker(1307908000112, 1307908172259, 800, options)); + assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"},{"v":1307908170000,"label":"19:49:30"}], ticker(1307908000112, 1307908173260, 800, options)); + assert.deepEqual([{"v":978307200000,"label":"Jan 2001"},{"v":986083200000,"label":"Apr 2001"},{"v":993945600000,"label":"Jul 2001"},{"v":1001894400000,"label":"Oct 2001"}], ticker(978307200000, 1001894400000, 400, options)); +}); + +}); diff --git a/auto_tests/tests/dygraph-options-tests.js b/auto_tests/tests/dygraph-options-tests.js index 7222a21..4311fb5 100644 --- a/auto_tests/tests/dygraph-options-tests.js +++ b/auto_tests/tests/dygraph-options-tests.js @@ -1,19 +1,22 @@ /** * @fileoverview Test cases for DygraphOptions. */ -var DygraphOptionsTestCase = TestCase("dygraph-options-tests"); +describe("dygraph-options-tests", function() { -DygraphOptionsTestCase.prototype.setUp = function() { +var graph; + +beforeEach(function() { document.body.innerHTML = "
"; -}; + graph = document.getElementById("graph"); +}); -DygraphOptionsTestCase.prototype.tearDown = function() { -}; +afterEach(function() { +}); /* * Pathalogical test to ensure getSeriesNames works */ -DygraphOptionsTestCase.prototype.testGetSeriesNames = function() { +it('testGetSeriesNames', function() { var opts = { width: 480, height: 320 @@ -22,20 +25,19 @@ DygraphOptionsTestCase.prototype.testGetSeriesNames = function() { "0,-1,0,0"; // Kind of annoying that you need a DOM to test the object. - var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); // We don't need to get at g's attributes_ object just // to test DygraphOptions. var o = new DygraphOptions(g); - assertEquals(["Y", "Y2", "Y3"], o.seriesNames()); -}; + assert.deepEqual(["Y", "Y2", "Y3"], o.seriesNames()); +}); /* * Ensures that even if logscale is set globally, it doesn't impact the * x axis. */ -DygraphOptionsTestCase.prototype.testGetLogscaleForX = function() { +it('testGetLogscaleForX', function() { var opts = { width: 480, height: 320 @@ -44,16 +46,15 @@ DygraphOptionsTestCase.prototype.testGetLogscaleForX = function() { "1,-1,2,3"; // Kind of annoying that you need a DOM to test the object. - var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - assertFalse(!!g.getOptionForAxis('logscale', 'x')); - assertFalse(!!g.getOptionForAxis('logscale', 'y')); + assert.isFalse(!!g.getOptionForAxis('logscale', 'x')); + assert.isFalse(!!g.getOptionForAxis('logscale', 'y')); g.updateOptions({ logscale : true }); - assertFalse(!!g.getOptionForAxis('logscale', 'x')); - assertTrue(!!g.getOptionForAxis('logscale', 'y')); -}; + assert.isFalse(!!g.getOptionForAxis('logscale', 'x')); + assert.isTrue(!!g.getOptionForAxis('logscale', 'y')); +}); // Helper to gather all warnings emitted by Dygraph constructor. // Removes everything after the first open parenthesis in each warning. @@ -72,24 +73,23 @@ var getWarnings = function(div, data, opts) { return warnings; }; -DygraphOptionsTestCase.prototype.testLogWarningForNonexistentOption = function() { +it('testLogWarningForNonexistentOption', function() { if (typeof(Dygraph.OPTIONS_REFERENCE) === 'undefined') { return; // this test won't pass in non-debug mode. } - var graph = document.getElementById("graph"); var data = "X,Y,Y2,Y3\n" + "1,-1,2,3"; var expectWarning = function(opts, badOptionName) { DygraphOptions.resetWarnings_(); var warnings = getWarnings(graph, data, opts); - assertEquals(['Unknown option ' + badOptionName], warnings); + assert.deepEqual(['Unknown option ' + badOptionName], warnings); }; var expectNoWarning = function(opts) { DygraphOptions.resetWarnings_(); var warnings = getWarnings(graph, data, opts); - assertEquals([], warnings); + assert.deepEqual([], warnings); }; expectNoWarning({}); @@ -100,19 +100,20 @@ DygraphOptionsTestCase.prototype.testLogWarningForNonexistentOption = function() expectWarning({highlightSeriesOpts: {anotherNonExistentOption: true}}, 'anotherNonExistentOption'); expectNoWarning({highlightSeriesOpts: {strokeWidth: 20}}); expectNoWarning({strokeWidth: 20}); -}; +}); -DygraphOptionsTestCase.prototype.testOnlyLogsEachWarningOnce = function() { +it('testOnlyLogsEachWarningOnce', function() { if (typeof(Dygraph.OPTIONS_REFERENCE) === 'undefined') { return; // this test won't pass in non-debug mode. } - var graph = document.getElementById("graph"); var data = "X,Y,Y2,Y3\n" + "1,-1,2,3"; var warnings1 = getWarnings(graph, data, {nonExistent: true}); var warnings2 = getWarnings(graph, data, {nonExistent: true}); - assertEquals(['Unknown option nonExistent'], warnings1); - assertEquals([], warnings2); -}; + assert.deepEqual(['Unknown option nonExistent'], warnings1); + assert.deepEqual([], warnings2); +}); + +}); diff --git a/auto_tests/tests/error_bars.js b/auto_tests/tests/error_bars.js index 8adc075..4a1d10a 100644 --- a/auto_tests/tests/error_bars.js +++ b/auto_tests/tests/error_bars.js @@ -3,25 +3,25 @@ * * @author danvk@google.com (Dan Vanderkam) */ -var errorBarsTestCase = TestCase("error-bars"); +describe("error-bars", function() { -errorBarsTestCase.prototype.setUp = function() { +beforeEach(function() { document.body.innerHTML = "
"; -}; +}); var _origFunc = Dygraph.getContext; -errorBarsTestCase.prototype.setUp = function() { +beforeEach(function() { document.body.innerHTML = "
"; Dygraph.getContext = function(canvas) { return new Proxy(_origFunc(canvas)); } -}; +}); -errorBarsTestCase.prototype.tearDown = function() { +afterEach(function() { Dygraph.getContext = _origFunc; -}; +}); -errorBarsTestCase.prototype.testErrorBarsDrawn = function() { +it('testErrorBarsDrawn', function() { var opts = { width: 480, height: 320, @@ -53,7 +53,7 @@ errorBarsTestCase.prototype.testErrorBarsDrawn = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - htx = g.hidden_ctx_; + var htx = g.hidden_ctx_; var attrs = {}; // TODO(danvk): fill in @@ -94,9 +94,9 @@ errorBarsTestCase.prototype.testErrorBarsDrawn = function() { } g.destroy(); // Restore balanced saves and restores. CanvasAssertions.assertBalancedSaveRestore(htx); -}; +}); -errorBarsTestCase.prototype.testErrorBarsCorrectColors = function() { +it('testErrorBarsCorrectColors', function() { // Two constant series with constant error. var data = [ [0, [100, 50], [200, 50]], @@ -137,15 +137,15 @@ errorBarsTestCase.prototype.testErrorBarsCorrectColors = function() { // 249-299: empty (white) // TODO(danvk): test the edges of these regions. - assertEquals([0, 0, 255, 38], Util.samplePixel(g.hidden_, 200, 75)); - assertEquals([0, 0, 255, 38], Util.samplePixel(g.hidden_, 200, 125)); - assertEquals([0, 255, 0, 38], Util.samplePixel(g.hidden_, 200, 175)); - assertEquals([0, 255, 0, 38], Util.samplePixel(g.hidden_, 200, 225)); -}; + assert.deepEqual([0, 0, 255, 38], Util.samplePixel(g.hidden_, 200, 75)); + assert.deepEqual([0, 0, 255, 38], Util.samplePixel(g.hidden_, 200, 125)); + assert.deepEqual([0, 255, 0, 38], Util.samplePixel(g.hidden_, 200, 175)); + assert.deepEqual([0, 255, 0, 38], Util.samplePixel(g.hidden_, 200, 225)); +}); // Regression test for http://code.google.com/p/dygraphs/issues/detail?id=392 -errorBarsTestCase.prototype.testRollingAveragePreservesNaNs = function() { +it('testRollingAveragePreservesNaNs', function() { var graph = document.getElementById("graph"); var data = [ @@ -169,18 +169,20 @@ errorBarsTestCase.prototype.testRollingAveragePreservesNaNs = function() { var in_series = g.dataHandler_.extractSeries(data, 1, g.attributes_); - assertEquals(null, in_series[4][1]); - assertEquals(null, in_series[4][2][0]); - assertEquals(null, in_series[4][2][1]); - assertNaN(in_series[5][1]); - assertNaN(in_series[5][2][0]); - assertNaN(in_series[5][2][1]); + assert.equal(null, in_series[4][1]); + assert.equal(null, in_series[4][2][0]); + assert.equal(null, in_series[4][2][1]); + assert.isNaN(in_series[5][1]); + assert.isNaN(in_series[5][2][0]); + assert.isNaN(in_series[5][2][1]); var out_series = g.dataHandler_.rollingAverage(in_series, 1, g.attributes_); - assertNaN(out_series[5][1]); - assertNaN(out_series[5][2][0]); - assertNaN(out_series[5][2][1]); - assertEquals(null, out_series[4][1]); - assertEquals(null, out_series[4][2][0]); - assertEquals(null, out_series[4][2][1]); -}; + assert.isNaN(out_series[5][1]); + assert.isNaN(out_series[5][2][0]); + assert.isNaN(out_series[5][2][1]); + assert.equal(null, out_series[4][1]); + assert.equal(null, out_series[4][2][0]); + assert.equal(null, out_series[4][2][1]); +}); + +}); diff --git a/auto_tests/tests/fast_canvas_proxy.js b/auto_tests/tests/fast_canvas_proxy.js index 1e4bfaf..a06fe40 100644 --- a/auto_tests/tests/fast_canvas_proxy.js +++ b/auto_tests/tests/fast_canvas_proxy.js @@ -3,13 +3,13 @@ * * @author danvdk@gmail.com (Dan Vanderkam) */ -var fastCanvasProxyTestCase = TestCase("fast-canvas-proxy"); +describe("fast-canvas-proxy", function() { -fastCanvasProxyTestCase.prototype.setUp = function() { -}; +beforeEach(function() { +}); -fastCanvasProxyTestCase.prototype.tearDown = function() { -}; +afterEach(function() { +}); var fakeCanvasContext = { moveTo: function() {}, @@ -32,7 +32,7 @@ function extractMoveToAndLineToCalls(proxy) { return out; } -fastCanvasProxyTestCase.prototype.testExtraMoveTosElided = function() { +it('testExtraMoveTosElided', function() { var htx = new Proxy(fakeCanvasContext); var fastProxy = DygraphCanvasRenderer._fastCanvasProxy(htx); @@ -43,12 +43,12 @@ fastCanvasProxyTestCase.prototype.testExtraMoveTosElided = function() { fastProxy.moveTo(3, 1); fastProxy.stroke(); - assertEquals([['moveTo', 1, 1], + assert.deepEqual([['moveTo', 1, 1], ['lineTo', 2, 1], ['lineTo', 3, 1]], extractMoveToAndLineToCalls(htx)); -}; +}); -fastCanvasProxyTestCase.prototype.testConsecutiveMoveTosElided = function() { +it('testConsecutiveMoveTosElided', function() { var htx = new Proxy(fakeCanvasContext); var fastProxy = DygraphCanvasRenderer._fastCanvasProxy(htx); @@ -59,12 +59,12 @@ fastCanvasProxyTestCase.prototype.testConsecutiveMoveTosElided = function() { fastProxy.moveTo(3.2, 3); fastProxy.stroke(); - assertEquals([['moveTo', 1, 1], + assert.deepEqual([['moveTo', 1, 1], ['lineTo', 2, 1], ['moveTo', 3.2, 3]], extractMoveToAndLineToCalls(htx)); -}; +}); -fastCanvasProxyTestCase.prototype.testSuperfluousSegmentsElided = function() { +it('testSuperfluousSegmentsElided', function() { var htx = new Proxy(fakeCanvasContext); var fastProxy = DygraphCanvasRenderer._fastCanvasProxy(htx); @@ -90,10 +90,12 @@ fastCanvasProxyTestCase.prototype.testSuperfluousSegmentsElided = function() { fastProxy.moveTo(3, 0); // dodge the "don't touch the last pixel" rule. fastProxy.stroke(); - assertEquals([['moveTo', 0.6, 1], + assert.deepEqual([['moveTo', 0.6, 1], ['lineTo', 1.0, 5], ['lineTo', 1.2, 0], ['lineTo', 1.7, 30], ['lineTo', 1.8, -30], ['moveTo', 3, 0]], extractMoveToAndLineToCalls(htx)); -}; +}); + +}); diff --git a/auto_tests/tests/fill_step_plot.js b/auto_tests/tests/fill_step_plot.js index be1302b..6406016 100644 --- a/auto_tests/tests/fill_step_plot.js +++ b/auto_tests/tests/fill_step_plot.js @@ -4,27 +4,27 @@ * * @author benoitboivin.pro@gmail.com (Benoit Boivin) */ -var fillStepPlotTestCase = TestCase("fill-step-plot"); +describe("fill-step-plot", function() { -fillStepPlotTestCase.prototype.setUp = function() { +beforeEach(function() { document.body.innerHTML = "
"; -}; +}); var origFunc = Dygraph.getContext; -fillStepPlotTestCase.prototype.setUp = function() { +beforeEach(function() { document.body.innerHTML = "
"; Dygraph.getContext = function(canvas) { return new Proxy(origFunc(canvas)); }; -}; +}); -fillStepPlotTestCase.prototype.tearDown = function() { +afterEach(function() { Dygraph.getContext = origFunc; -}; +}); -fillStepPlotTestCase.prototype.testFillStepPlotNullValues = function() { +it('testFillStepPlotNullValues', function() { var opts = { labels: ["x","y"], width: 480, @@ -45,7 +45,7 @@ fillStepPlotTestCase.prototype.testFillStepPlotNullValues = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - htx = g.hidden_ctx_; + var htx = g.hidden_ctx_; var x1 = data[3][0]; var y1 = data[2][1]; var x2 = data[3][0]; @@ -55,4 +55,6 @@ fillStepPlotTestCase.prototype.testFillStepPlotNullValues = function() { // Check if a line is drawn between the previous y and the bottom of the chart CanvasAssertions.assertLineDrawn(htx, xy1, xy2, {}); -}; +}); + +}); diff --git a/auto_tests/tests/formats.js b/auto_tests/tests/formats.js index 0866a26..36b36c9 100644 --- a/auto_tests/tests/formats.js +++ b/auto_tests/tests/formats.js @@ -3,14 +3,14 @@ * * @author konigsberg@google.com (Robert Konigsberg) */ -var FormatsTestCase = TestCase("formats"); +describe("formats", function() { -FormatsTestCase.prototype.setUp = function() { +beforeEach(function() { document.body.innerHTML = "
"; -}; +}); -FormatsTestCase.prototype.tearDown = function() { -}; +afterEach(function() { +}); var dataString = "X,Y\n" + @@ -25,21 +25,21 @@ var dataArray = [2,1], [3,0]]; -FormatsTestCase.prototype.testCsv = function() { +it('testCsv', function() { var data = dataString; var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, {}); assertData(g); -}; +}); -FormatsTestCase.prototype.testArray = function() { +it('testArray', function() { var data = dataArray; var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, {}); assertData(g); -}; +}); -FormatsTestCase.prototype.testFunctionReturnsCsv = function() { +it('testFunctionReturnsCsv', function() { var string = dataString; var data = function() { return string; }; @@ -47,18 +47,18 @@ FormatsTestCase.prototype.testFunctionReturnsCsv = function() { var g = new Dygraph(graph, data, {}); // assertData(g); console.log("x"); -}; +}); -FormatsTestCase.prototype.testFunctionDefinesArray = function() { +it('testFunctionDefinesArray', function() { var array = dataArray; var data = function() { return array; } var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, {}); assertData(g); -}; +}); -FormatsTestCase.prototype.testXValueParser = function() { +it('testXValueParser', function() { var data = "X,Y\n" + "d,-1\n" + @@ -69,26 +69,28 @@ FormatsTestCase.prototype.testXValueParser = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, { xValueParser : function(str) { - assertEquals(1, str.length); + assert.equal(1, str.length); return str.charCodeAt(0) - "a".charCodeAt(0); } }); - assertEquals(3, g.getValue(0, 0)); - assertEquals(4, g.getValue(1, 0)); - assertEquals(5, g.getValue(2, 0)); - assertEquals(6, g.getValue(3, 0)); -}; + assert.equal(3, g.getValue(0, 0)); + assert.equal(4, g.getValue(1, 0)); + assert.equal(5, g.getValue(2, 0)); + assert.equal(6, g.getValue(3, 0)); +}); var assertData = function(g) { var expected = dataArray; - assertEquals(4, g.numRows()); - assertEquals(2, g.numColumns()); + assert.equal(4, g.numRows()); + assert.equal(2, g.numColumns()); for (var i = 0; i < 4; i++) { for (var j = 0; j < 2; j++) { - assertEquals(expected[i][j], g.getValue(i, j)); + assert.equal(expected[i][j], g.getValue(i, j)); } } }; + +}); diff --git a/auto_tests/tests/grid_per_axis.js b/auto_tests/tests/grid_per_axis.js index 3173cf3..580bf2f 100644 --- a/auto_tests/tests/grid_per_axis.js +++ b/auto_tests/tests/grid_per_axis.js @@ -4,26 +4,26 @@ * * @author david.eberlein@ch.sauter-bc.com (Fr. Sauter AG) */ -var GridPerAxisTestCase = TestCase("grid-per-axis"); +describe("grid-per-axis", function() { -GridPerAxisTestCase.prototype.setUp = function() { +beforeEach(function() { document.body.innerHTML = "
"; -}; +}); var origFunc = Dygraph.getContext; -GridPerAxisTestCase.prototype.setUp = function() { +beforeEach(function() { document.body.innerHTML = "
"; Dygraph.getContext = function(canvas) { return new Proxy(origFunc(canvas)); }; -}; +}); -GridPerAxisTestCase.prototype.tearDown = function() { +afterEach(function() { Dygraph.getContext = origFunc; -}; +}); -GridPerAxisTestCase.prototype.testIndependentGrids = function() { +it('testIndependentGrids', function() { var opts = { width : 480, height : 320, @@ -50,7 +50,7 @@ GridPerAxisTestCase.prototype.testIndependentGrids = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - htx = g.hidden_ctx_; + var htx = g.hidden_ctx_; // The expected gridlines var yGridlines = [ 0, 20, 40, 60, 80, 100, 120 ]; @@ -72,7 +72,7 @@ GridPerAxisTestCase.prototype.testIndependentGrids = function() { for ( var i = 0; i < gridlines[axis].length; i++) { // Check the labels: var labels = Util.getYLabels(axis + 1); - assertEquals("Expected label not found.", gridlines[axis][i], labels[i]); + assert.equal("Expected label not found.", gridlines[axis][i], labels[i]); // Check that the grid was drawn. y = halfDown(g.toDomYCoord(gridlines[axis][i], axis)); @@ -81,9 +81,9 @@ GridPerAxisTestCase.prototype.testIndependentGrids = function() { CanvasAssertions.assertLineDrawn(htx, p1, p2, attrs); } } -}; +}); -GridPerAxisTestCase.prototype.testPerAxisGridColors = function() { +it('testPerAxisGridColors', function() { var opts = { width : 480, height : 320, @@ -114,7 +114,7 @@ GridPerAxisTestCase.prototype.testPerAxisGridColors = function() { [ 5, 110, 333 ] ]; var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - htx = g.hidden_ctx_; + var htx = g.hidden_ctx_; // The expected gridlines var yGridlines = [ 20, 40, 60, 80, 100, 120 ]; @@ -136,12 +136,12 @@ GridPerAxisTestCase.prototype.testPerAxisGridColors = function() { for ( var i = 0; i < gridlines[axis].length; i++) { y = halfDown(g.toDomYCoord(gridlines[axis][i], axis)); // Check the grid colors. - assertEquals("Unexpected grid color found at pixel: x: " + x + "y: " + y, + assert.equal("Unexpected grid color found at pixel: x: " + x + "y: " + y, gridColors[axis], Util.samplePixel(g.hidden_, x, y)); } } -}; -GridPerAxisTestCase.prototype.testPerAxisGridWidth = function() { +}); +it('testPerAxisGridWidth', function() { var opts = { width : 480, height : 320, @@ -174,7 +174,7 @@ GridPerAxisTestCase.prototype.testPerAxisGridWidth = function() { [ 5, 110, 333 ] ]; var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - htx = g.hidden_ctx_; + var htx = g.hidden_ctx_; // The expected gridlines var yGridlines = [ 20, 40, 60, 80 ]; @@ -208,23 +208,23 @@ GridPerAxisTestCase.prototype.testPerAxisGridWidth = function() { // Check the grid width. switch (axis) { case 0: // y with 2 pixels width - assertEquals("Unexpected y-grid color found at pixel: x: " + x + "y: " + assert.equal("Unexpected y-grid color found at pixel: x: " + x + "y: " + y, emptyColor, drawnPixeldown2); - assertEquals("Unexpected y-grid color found at pixel: x: " + x + "y: " + assert.equal("Unexpected y-grid color found at pixel: x: " + x + "y: " + y, gridColor, drawnPixeldown1); - assertEquals("Unexpected y-grid color found at pixel: x: " + x + "y: " + assert.equal("Unexpected y-grid color found at pixel: x: " + x + "y: " + y, gridColor, drawnPixel); - assertEquals("Unexpected y-grid color found at pixel: x: " + x + "y: " + assert.equal("Unexpected y-grid color found at pixel: x: " + x + "y: " + y, gridColor, drawnPixelup1); - assertEquals("Unexpected y-grid color found at pixel: x: " + x + "y: " + assert.equal("Unexpected y-grid color found at pixel: x: " + x + "y: " + y, emptyColor, drawnPixelup2); break; case 1: // y2 with 1 pixel width - assertEquals("Unexpected y2-grid color found at pixel: x: " + x + "y: " + assert.equal("Unexpected y2-grid color found at pixel: x: " + x + "y: " + y, emptyColor, drawnPixeldown1); - assertEquals("Unexpected y2-grid color found at pixel: x: " + x + "y: " + assert.equal("Unexpected y2-grid color found at pixel: x: " + x + "y: " + y, gridColor, drawnPixel); - assertEquals("Unexpected y2-grid color found at pixel: x: " + x + "y: " + assert.equal("Unexpected y2-grid color found at pixel: x: " + x + "y: " + y, emptyColor, drawnPixelup1); break; } @@ -235,24 +235,24 @@ GridPerAxisTestCase.prototype.testPerAxisGridWidth = function() { y = halfDown(g.plotter_.area.y) + 10; for ( var i = 0; i < xGridlines.length; i++) { x = halfUp(g.toDomXCoord(xGridlines[i])); - assertEquals("Unexpected x-grid color found at pixel: x: " + x + "y: " + y, + assert.equal("Unexpected x-grid color found at pixel: x: " + x + "y: " + y, emptyColor, Util.samplePixel(g.hidden_, x - 4, y).slice(0, 3)); - assertEquals("Unexpected x-grid color found at pixel: x: " + x + "y: " + y, + assert.equal("Unexpected x-grid color found at pixel: x: " + x + "y: " + y, gridColor, Util.samplePixel(g.hidden_, x - 3, y).slice(0, 3)); - assertEquals("Unexpected x-grid color found at pixel: x: " + x + "y: " + y, + assert.equal("Unexpected x-grid color found at pixel: x: " + x + "y: " + y, gridColor, Util.samplePixel(g.hidden_, x - 2, y).slice(0, 3)); - assertEquals("Unexpected x-grid color found at pixel: x: " + x + "y: " + y, + assert.equal("Unexpected x-grid color found at pixel: x: " + x + "y: " + y, gridColor, Util.samplePixel(g.hidden_, x - 1, y).slice(0, 3)); - assertEquals("Unexpected x-grid color found at pixel: x: " + x + "y: " + y, + assert.equal("Unexpected x-grid color found at pixel: x: " + x + "y: " + y, gridColor, Util.samplePixel(g.hidden_, x, y).slice(0, 3)); - assertEquals("Unexpected x-grid color found at pixel: x: " + x + "y: " + y, + assert.equal("Unexpected x-grid color found at pixel: x: " + x + "y: " + y, gridColor, Util.samplePixel(g.hidden_, x + 1, y).slice(0, 3)); - assertEquals("Unexpected x-grid color found at pixel: x: " + x + "y: " + y, + assert.equal("Unexpected x-grid color found at pixel: x: " + x + "y: " + y, emptyColor, Util.samplePixel(g.hidden_, x + 2, y).slice(0, 3)); } -}; +}); -GridPerAxisTestCase.prototype.testGridLinePattern = function() { +it('testGridLinePattern', function() { var opts = { width : 120, height : 320, @@ -283,7 +283,7 @@ GridPerAxisTestCase.prototype.testGridLinePattern = function() { [ 5, 110, 333 ] ]; var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - htx = g.hidden_ctx_; + var htx = g.hidden_ctx_; // The expected gridlines var yGridlines = [ 0, 20, 40, 60, 80, 100, 120 ]; @@ -309,14 +309,16 @@ GridPerAxisTestCase.prototype.testGridLinePattern = function() { var pattern = (Math.floor((x) / 10)) % 2; switch (pattern) { case 0: // fill - assertEquals("Unexpected filled grid-pattern color found at pixel: x: " + x + " y: " + assert.equal("Unexpected filled grid-pattern color found at pixel: x: " + x + " y: " + y, [ 0, 0, 255 ], drawnPixel); break; case 1: // no fill - assertEquals("Unexpected empty grid-pattern color found at pixel: x: " + x + " y: " + assert.equal("Unexpected empty grid-pattern color found at pixel: x: " + x + " y: " + y, [ 0, 0, 0 ], drawnPixel); break; } } } -}; +}); + +}); diff --git a/auto_tests/tests/hidpi.js b/auto_tests/tests/hidpi.js index c595065..cdf0ee4 100644 --- a/auto_tests/tests/hidpi.js +++ b/auto_tests/tests/hidpi.js @@ -3,21 +3,21 @@ * * @author danvdk@gmail.com (Dan Vanderkam) */ -var hidpiTestCase = TestCase("hidpi"); +describe("hidpi", function() { var savePixelRatio; -hidpiTestCase.prototype.setUp = function() { +beforeEach(function() { savePixelRatio = window.devicePixelRatio; window.devicePixelRatio = 2; document.body.innerHTML = "
"; -}; +}); -hidpiTestCase.prototype.tearDown = function() { +afterEach(function() { window.devicePixelRatio = savePixelRatio; -}; +}); -hidpiTestCase.prototype.testDoesntCreateScrollbars = function() { +it('testDoesntCreateScrollbars', function() { var sw = document.body.scrollWidth; var cw = document.body.clientWidth; @@ -38,7 +38,9 @@ hidpiTestCase.prototype.testDoesntCreateScrollbars = function() { // Adding the graph shouldn't cause the width of the page to change. // (essentially, we're checking that we don't end up with a scrollbar) // See http://stackoverflow.com/a/2146905/388951 - assertEquals(cw, document.body.clientWidth); - assertEquals(sw, document.body.scrollWidth); -}; + assert.equal(cw, document.body.clientWidth); + assert.equal(sw, document.body.scrollWidth); +}); + +}); diff --git a/auto_tests/tests/interaction_model.js b/auto_tests/tests/interaction_model.js index 600ab6c..0992f0a 100644 --- a/auto_tests/tests/interaction_model.js +++ b/auto_tests/tests/interaction_model.js @@ -3,14 +3,14 @@ * * @author konigsberg@google.com (Robert Konigsbrg) */ -var InteractionModelTestCase = TestCase("interaction-model"); +describe("interaction-model", function() { -InteractionModelTestCase.prototype.setUp = function() { +beforeEach(function() { document.body.innerHTML = "
"; -}; +}); -InteractionModelTestCase.prototype.tearDown = function() { -}; +afterEach(function() { +}); var data1 = "X,Y\n" + "20,-1\n" + @@ -38,7 +38,8 @@ function getXLabels() { return ary; } -InteractionModelTestCase.prototype.testPan = function(g, xRange, yRange) { +/* +it('testPan', function() { var originalXRange = g.xAxisRange(); var originalYRange = g.yAxisRange(0); @@ -46,23 +47,24 @@ InteractionModelTestCase.prototype.testPan = function(g, xRange, yRange) { DygraphOps.dispatchMouseMove(g, xRange[1], yRange[0]); // this is really necessary. DygraphOps.dispatchMouseUp(g, xRange[1], yRange[0]); - assertEqualsDelta(xRange, g.xAxisRange(), 0.2); - // assertEqualsDelta(originalYRange, g.yAxisRange(0), 0.2); // Not true, it's something in the middle. + assert.equalsDelta(xRange, g.xAxisRange(), 0.2); + // assert.equalsDelta(originalYRange, g.yAxisRange(0), 0.2); // Not true, it's something in the middle. var midX = (xRange[1] - xRange[0]) / 2; DygraphOps.dispatchMouseDown(g, midX, yRange[0]); DygraphOps.dispatchMouseMove(g, midX, yRange[1]); // this is really necessary. DygraphOps.dispatchMouseUp(g, midX, yRange[1]); - assertEqualsDelta(xRange, g.xAxisRange(), 0.2); - assertEqualsDelta(yRange, g.yAxisRange(0), 0.2); -} + assert.equalsDelta(xRange, g.xAxisRange(), 0.2); + assert.equalsDelta(yRange, g.yAxisRange(0), 0.2); +}); +*/ /** * This tests that when changing the interaction model so pan is used instead * of zoom as the default behavior, a standard click method is still called. */ -InteractionModelTestCase.prototype.testClickCallbackIsCalled = function() { +it('testClickCallbackIsCalled', function() { var clicked; var clickCallback = function(event, x) { @@ -81,14 +83,14 @@ InteractionModelTestCase.prototype.testClickCallbackIsCalled = function() { DygraphOps.dispatchMouseMove_Point(g, 10, 10); DygraphOps.dispatchMouseUp_Point(g, 10, 10); - assertEquals(20, clicked); -}; + assert.equal(20, clicked); +}); /** * This tests that when changing the interaction model so pan is used instead * of zoom as the default behavior, a standard click method is still called. */ -InteractionModelTestCase.prototype.testClickCallbackIsCalledOnCustomPan = function() { +it('testClickCallbackIsCalledOnCustomPan', function() { var clicked; var clickCallback = function(event, x) { @@ -126,8 +128,8 @@ InteractionModelTestCase.prototype.testClickCallbackIsCalledOnCustomPan = functi DygraphOps.dispatchMouseMove_Point(g, 10, 10); DygraphOps.dispatchMouseUp_Point(g, 10, 10); - assertEquals(20, clicked); -}; + assert.equal(20, clicked); +}); var clickAt = function(g, x, y) { DygraphOps.dispatchMouseDown(g, x, y); @@ -138,7 +140,7 @@ var clickAt = function(g, x, y) { /** * This tests that clickCallback is still called with the nonInteractiveModel. */ -InteractionModelTestCase.prototype.testClickCallbackIsCalledWithNonInteractiveModel = function() { +it('testClickCallbackIsCalledWithNonInteractiveModel', function() { var clicked; // TODO(danvk): also test pointClickCallback here. @@ -160,13 +162,13 @@ InteractionModelTestCase.prototype.testClickCallbackIsCalledWithNonInteractiveMo DygraphOps.dispatchMouseMove_Point(g, 10, 10); DygraphOps.dispatchMouseUp_Point(g, 10, 10); - assertEquals(20, clicked); -}; + assert.equal(20, clicked); +}); /** * A sanity test to ensure pointClickCallback is called. */ -InteractionModelTestCase.prototype.testPointClickCallback = function() { +it('testPointClickCallback', function() { var clicked; var g = new Dygraph(document.getElementById("graph"), data2, { pointClickCallback : function(event, point) { @@ -176,14 +178,14 @@ InteractionModelTestCase.prototype.testPointClickCallback = function() { clickAt(g, 4, 40); - assertEquals(4, clicked.xval); - assertEquals(40, clicked.yval); -}; + assert.equal(4, clicked.xval); + assert.equal(40, clicked.yval); +}); /** * A sanity test to ensure pointClickCallback is not called when out of range. */ -InteractionModelTestCase.prototype.testNoPointClickCallbackWhenOffPoint = function() { +it('testNoPointClickCallbackWhenOffPoint', function() { var clicked; var g = new Dygraph(document.getElementById("graph"), data2, { pointClickCallback : function(event, point) { @@ -193,20 +195,20 @@ InteractionModelTestCase.prototype.testNoPointClickCallbackWhenOffPoint = functi clickAt(g, 5, 40); - assertUndefined(clicked); -}; + assert.isUndefined(clicked); +}); /** * Ensures pointClickCallback circle size is taken into account. */ -InteractionModelTestCase.prototype.testPointClickCallback_circleSize = function() { +it('testPointClickCallback_circleSize', function() { // TODO(konigsberg): Implement. -}; +}); /** * Ensures that pointClickCallback is called prior to clickCallback */ -InteractionModelTestCase.prototype.testPointClickCallbackCalledPriorToClickCallback = function() { +it('testPointClickCallbackCalledPriorToClickCallback', function() { var counter = 0; var pointClicked; var clicked; @@ -222,15 +224,15 @@ InteractionModelTestCase.prototype.testPointClickCallbackCalledPriorToClickCallb }); clickAt(g, 4, 40); - assertEquals(1, pointClicked); - assertEquals(2, clicked); -}; + assert.equal(1, pointClicked); + assert.equal(2, clicked); +}); /** * Ensures that when there's no pointClickCallback, clicking on a point still calls * clickCallback */ -InteractionModelTestCase.prototype.testClickCallback_clickOnPoint = function() { +it('testClickCallback_clickOnPoint', function() { var clicked; var g = new Dygraph(document.getElementById("graph"), data2, { clickCallback : function(event, point) { @@ -239,42 +241,42 @@ InteractionModelTestCase.prototype.testClickCallback_clickOnPoint = function() { }); clickAt(g, 4, 40); - assertEquals(1, clicked); -}; + assert.equal(1, clicked); +}); -InteractionModelTestCase.prototype.testIsZoomed_none = function() { +it('testIsZoomed_none', function() { var g = new Dygraph(document.getElementById("graph"), data2, {}); - assertFalse(g.isZoomed()); - assertFalse(g.isZoomed("x")); - assertFalse(g.isZoomed("y")); -}; + assert.isFalse(g.isZoomed()); + assert.isFalse(g.isZoomed("x")); + assert.isFalse(g.isZoomed("y")); +}); -InteractionModelTestCase.prototype.testIsZoomed_x = function() { +it('testIsZoomed_x', function() { var g = new Dygraph(document.getElementById("graph"), data2, {}); DygraphOps.dispatchMouseDown_Point(g, 100, 100); DygraphOps.dispatchMouseMove_Point(g, 130, 100); DygraphOps.dispatchMouseUp_Point(g, 130, 100); - assertTrue(g.isZoomed()); - assertTrue(g.isZoomed("x")); - assertFalse(g.isZoomed("y")); -}; + assert.isTrue(g.isZoomed()); + assert.isTrue(g.isZoomed("x")); + assert.isFalse(g.isZoomed("y")); +}); -InteractionModelTestCase.prototype.testIsZoomed_y = function() { +it('testIsZoomed_y', function() { var g = new Dygraph(document.getElementById("graph"), data2, {}); DygraphOps.dispatchMouseDown_Point(g, 10, 10); DygraphOps.dispatchMouseMove_Point(g, 10, 30); DygraphOps.dispatchMouseUp_Point(g, 10, 30); - assertTrue(g.isZoomed()); - assertFalse(g.isZoomed("x")); - assertTrue(g.isZoomed("y")); -}; + assert.isTrue(g.isZoomed()); + assert.isFalse(g.isZoomed("x")); + assert.isTrue(g.isZoomed("y")); +}); -InteractionModelTestCase.prototype.testIsZoomed_both = function() { +it('testIsZoomed_both', function() { var g = new Dygraph(document.getElementById("graph"), data2, {}); // Zoom x axis @@ -288,52 +290,52 @@ InteractionModelTestCase.prototype.testIsZoomed_both = function() { DygraphOps.dispatchMouseUp_Point(g, 100, 130); - assertTrue(g.isZoomed()); - assertTrue(g.isZoomed("x")); - assertTrue(g.isZoomed("y")); -}; + assert.isTrue(g.isZoomed()); + assert.isTrue(g.isZoomed("x")); + assert.isTrue(g.isZoomed("y")); +}); -InteractionModelTestCase.prototype.testIsZoomed_updateOptions_none = function() { +it('testIsZoomed_updateOptions_none', function() { var g = new Dygraph(document.getElementById("graph"), data2, {}); g.updateOptions({}); - assertFalse(g.isZoomed()); - assertFalse(g.isZoomed("x")); - assertFalse(g.isZoomed("y")); -}; + assert.isFalse(g.isZoomed()); + assert.isFalse(g.isZoomed("x")); + assert.isFalse(g.isZoomed("y")); +}); -InteractionModelTestCase.prototype.testIsZoomed_updateOptions_x = function() { +it('testIsZoomed_updateOptions_x', function() { var g = new Dygraph(document.getElementById("graph"), data2, {}); g.updateOptions({dateWindow: [-.5, .3]}); - assertTrue(g.isZoomed()); - assertTrue(g.isZoomed("x")); - assertFalse(g.isZoomed("y")); -}; + assert.isTrue(g.isZoomed()); + assert.isTrue(g.isZoomed("x")); + assert.isFalse(g.isZoomed("y")); +}); -InteractionModelTestCase.prototype.testIsZoomed_updateOptions_y = function() { +it('testIsZoomed_updateOptions_y', function() { var g = new Dygraph(document.getElementById("graph"), data2, {}); g.updateOptions({valueRange: [1, 10]}); - assertTrue(g.isZoomed()); - assertFalse(g.isZoomed("x")); - assertTrue(g.isZoomed("y")); -}; + assert.isTrue(g.isZoomed()); + assert.isFalse(g.isZoomed("x")); + assert.isTrue(g.isZoomed("y")); +}); -InteractionModelTestCase.prototype.testIsZoomed_updateOptions_both = function() { +it('testIsZoomed_updateOptions_both', function() { var g = new Dygraph(document.getElementById("graph"), data2, {}); g.updateOptions({dateWindow: [-1, 1], valueRange: [1, 10]}); - assertTrue(g.isZoomed()); - assertTrue(g.isZoomed("x")); - assertTrue(g.isZoomed("y")); -}; + assert.isTrue(g.isZoomed()); + assert.isTrue(g.isZoomed("x")); + assert.isTrue(g.isZoomed("y")); +}); -InteractionModelTestCase.prototype.testCorrectAxisValueRangeAfterUnzoom = function() { +it('testCorrectAxisValueRangeAfterUnzoom', function() { var g = new Dygraph(document.getElementById("graph"), data2, { valueRange: [1, 50], @@ -350,14 +352,14 @@ InteractionModelTestCase.prototype.testCorrectAxisValueRangeAfterUnzoom = functi DygraphOps.dispatchMouseDown_Point(g, 100, 100); DygraphOps.dispatchMouseMove_Point(g, 100, 130); DygraphOps.dispatchMouseUp_Point(g, 100, 130); - currentYAxisRange = g.yAxisRange(); - currentXAxisRange = g.xAxisRange(); + var currentYAxisRange = g.yAxisRange(); + var currentXAxisRange = g.xAxisRange(); //check that the range for the axis has changed - assertNotEquals(1, currentXAxisRange[0]); - assertNotEquals(10, currentXAxisRange[1]); - assertNotEquals(1, currentYAxisRange[0]); - assertNotEquals(50, currentYAxisRange[1]); + assert.notEqual(1, currentXAxisRange[0]); + assert.notEqual(10, currentXAxisRange[1]); + assert.notEqual(1, currentYAxisRange[0]); + assert.notEqual(50, currentYAxisRange[1]); // unzoom by doubleclick. This is really the order in which a browser // generates events, and we depend on it. @@ -370,16 +372,16 @@ InteractionModelTestCase.prototype.testCorrectAxisValueRangeAfterUnzoom = functi // check if range for y-axis was reset to original value // TODO check if range for x-axis is correct. // Currently not possible because dateRange is set to null and extremes are returned - newYAxisRange = g.yAxisRange(); - assertEquals(1, newYAxisRange[0]); - assertEquals(50, newYAxisRange[1]); -}; + var newYAxisRange = g.yAxisRange(); + assert.equal(1, newYAxisRange[0]); + assert.equal(50, newYAxisRange[1]); +}); /** * Ensures pointClickCallback is called when some points along the y-axis don't * exist. */ -InteractionModelTestCase.prototype.testPointClickCallback_missingData = function() { +it('testPointClickCallback_missingData', function() { // There's a B-value at 2, but no A-value. var data = @@ -399,6 +401,8 @@ InteractionModelTestCase.prototype.testPointClickCallback_missingData = function clickAt(g, 2, 110); - assertEquals(2, clicked.xval); - assertEquals(110, clicked.yval); -}; + assert.equal(2, clicked.xval); + assert.equal(110, clicked.yval); +}); + +}); diff --git a/auto_tests/tests/missing_points.js b/auto_tests/tests/missing_points.js index 835a301..cc1ae00 100644 --- a/auto_tests/tests/missing_points.js +++ b/auto_tests/tests/missing_points.js @@ -25,21 +25,21 @@ */ var ZERO_TO_FIFTY = [[ 10, 0 ] , [ 20, 50 ]]; -var MissingPointsTestCase = TestCase("missing-points"); +describe("missing-points", function() { var _origFunc = Dygraph.getContext; -MissingPointsTestCase.prototype.setUp = function() { +beforeEach(function() { document.body.innerHTML = "
"; Dygraph.getContext = function(canvas) { return new Proxy(_origFunc(canvas)); } -}; +}); -MissingPointsTestCase.prototype.tearDown = function() { +afterEach(function() { Dygraph.getContext = _origFunc; -}; +}); -MissingPointsTestCase.prototype.testSeparatedPointsDontDraw = function() { +it('testSeparatedPointsDontDraw', function() { var graph = document.getElementById("graph"); var g = new Dygraph( graph, @@ -48,11 +48,11 @@ MissingPointsTestCase.prototype.testSeparatedPointsDontDraw = function() { [3, 12, 13]], { colors: ['red', 'blue']}); var htx = g.hidden_ctx_; - assertEquals(2, CanvasAssertions.numLinesDrawn(htx, '#ff0000')); - assertEquals(0, CanvasAssertions.numLinesDrawn(htx, '#0000ff')); -}; + assert.equal(2, CanvasAssertions.numLinesDrawn(htx, '#ff0000')); + assert.equal(0, CanvasAssertions.numLinesDrawn(htx, '#0000ff')); +}); -MissingPointsTestCase.prototype.testSeparatedPointsDontDraw_expanded = function() { +it('testSeparatedPointsDontDraw_expanded', function() { var graph = document.getElementById("graph"); var g = new Dygraph( graph, @@ -64,14 +64,14 @@ MissingPointsTestCase.prototype.testSeparatedPointsDontDraw_expanded = function( { colors: ['blue']}); var htx = g.hidden_ctx_; - assertEquals(2, CanvasAssertions.numLinesDrawn(htx, '#0000ff')); + assert.equal(2, CanvasAssertions.numLinesDrawn(htx, '#0000ff')); CanvasAssertions.assertLineDrawn(htx, [56, 275], [161, 212], { strokeStyle: '#0000ff', }); CanvasAssertions.assertLineDrawn(htx, [370, 87], [475, 25], { strokeStyle: '#0000ff', }); -}; +}); -MissingPointsTestCase.prototype.testSeparatedPointsDontDraw_expanded_connected = function() { +it('testSeparatedPointsDontDraw_expanded_connected', function() { var graph = document.getElementById("graph"); var g = new Dygraph( graph, @@ -84,16 +84,16 @@ MissingPointsTestCase.prototype.testSeparatedPointsDontDraw_expanded_connected = var htx = g.hidden_ctx_; var num_lines = 0; - assertEquals(3, CanvasAssertions.numLinesDrawn(htx, '#0000ff')); + assert.equal(3, CanvasAssertions.numLinesDrawn(htx, '#0000ff')); CanvasAssertions.assertConsecutiveLinesDrawn(htx, [[56, 275], [161, 212], [370, 87], [475, 25]], { strokeStyle: '#0000ff' }); -}; +}); /** * At the time of writing this test, the blue series is only points, and not lines. */ -MissingPointsTestCase.prototype.testConnectSeparatedPoints = function() { +it('testConnectSeparatedPoints', function() { var g = new Dygraph( document.getElementById("graph"), [ @@ -113,21 +113,21 @@ MissingPointsTestCase.prototype.testConnectSeparatedPoints = function() { var htx = g.hidden_ctx_; - assertEquals(2, CanvasAssertions.numLinesDrawn(htx, '#0000ff')); + assert.equal(2, CanvasAssertions.numLinesDrawn(htx, '#0000ff')); CanvasAssertions.assertConsecutiveLinesDrawn(htx, [[56, 225], [223, 25], [391, 125]], { strokeStyle: '#0000ff' }); - assertEquals(2, CanvasAssertions.numLinesDrawn(htx, '#ff0000')); + assert.equal(2, CanvasAssertions.numLinesDrawn(htx, '#ff0000')); CanvasAssertions.assertConsecutiveLinesDrawn(htx, [[140, 275], [307, 125], [475, 225]], { strokeStyle: '#ff0000' }); -}; +}); /** * At the time of writing this test, the blue series is only points, and not lines. */ -MissingPointsTestCase.prototype.testConnectSeparatedPointsWithNan = function() { +it('testConnectSeparatedPointsWithNan', function() { var g = new Dygraph( document.getElementById("graph"), "x,A,B \n" + @@ -149,16 +149,16 @@ MissingPointsTestCase.prototype.testConnectSeparatedPointsWithNan = function() { var htx = g.hidden_ctx_; // Red has two disconnected line segments - assertEquals(2, CanvasAssertions.numLinesDrawn(htx, '#ff0000')); + assert.equal(2, CanvasAssertions.numLinesDrawn(htx, '#ff0000')); CanvasAssertions.assertLineDrawn(htx, [102, 275], [195, 212], { strokeStyle: '#ff0000' }); CanvasAssertions.assertLineDrawn(htx, [381, 87], [475, 25], { strokeStyle: '#ff0000' }); // Blue's lines are consecutive, however. - assertEquals(2, CanvasAssertions.numLinesDrawn(htx, '#0000ff')); + assert.equal(2, CanvasAssertions.numLinesDrawn(htx, '#0000ff')); CanvasAssertions.assertConsecutiveLinesDrawn(htx, [[56, 244], [149, 181], [242, 118]], { strokeStyle: '#0000ff' }); -}; +}); /* These lines contain awesome powa! var lines = CanvasAssertions.getLinesDrawn(htx, {strokeStyle: "#0000ff"}); @@ -168,7 +168,7 @@ MissingPointsTestCase.prototype.testConnectSeparatedPointsWithNan = function() { } */ -MissingPointsTestCase.prototype.testErrorBarsWithMissingPoints = function() { +it('testErrorBarsWithMissingPoints', function() { var data = [ [1, [2,1]], [2, [3,1]], @@ -188,7 +188,7 @@ MissingPointsTestCase.prototype.testErrorBarsWithMissingPoints = function() { var htx = g.hidden_ctx_; - assertEquals(2, CanvasAssertions.numLinesDrawn(htx, '#ff0000')); + assert.equal(2, CanvasAssertions.numLinesDrawn(htx, '#ff0000')); var p0 = g.toDomCoords(data[0][0], data[0][1][0]); var p1 = g.toDomCoords(data[1][0], data[1][1][0]); @@ -198,9 +198,9 @@ MissingPointsTestCase.prototype.testErrorBarsWithMissingPoints = function() { [p0, p1], { strokeStyle: '#ff0000' }); CanvasAssertions.assertConsecutiveLinesDrawn(htx, [p2, p3], { strokeStyle: '#ff0000' }); -}; +}); -MissingPointsTestCase.prototype.testErrorBarsWithMissingPointsConnected = function() { +it('testErrorBarsWithMissingPointsConnected', function() { var data = [ [1, [null,1]], [2, [2,1]], @@ -222,7 +222,7 @@ MissingPointsTestCase.prototype.testErrorBarsWithMissingPointsConnected = functi var htx = g.hidden_ctx_; - assertEquals(2, CanvasAssertions.numLinesDrawn(htx, '#ff0000')); + assert.equal(2, CanvasAssertions.numLinesDrawn(htx, '#ff0000')); var p1 = g.toDomCoords(data[1][0], data[1][1][0]); var p2 = g.toDomCoords(data[3][0], data[3][1][0]); @@ -230,8 +230,8 @@ MissingPointsTestCase.prototype.testErrorBarsWithMissingPointsConnected = functi CanvasAssertions.assertConsecutiveLinesDrawn(htx, [p1, p2, p3], { strokeStyle: '#ff0000' }); -}; -MissingPointsTestCase.prototype.testCustomBarsWithMissingPoints = function() { +}); +it('testCustomBarsWithMissingPoints', function() { var data = [ [1, [1,2,3]], [2, [2,3,4]], @@ -257,7 +257,7 @@ MissingPointsTestCase.prototype.testCustomBarsWithMissingPoints = function() { var htx = g.hidden_ctx_; - assertEquals(4, CanvasAssertions.numLinesDrawn(htx, '#ff0000')); + assert.equal(4, CanvasAssertions.numLinesDrawn(htx, '#ff0000')); var p0 = g.toDomCoords(data[0][0], data[0][1][1]); var p1 = g.toDomCoords(data[1][0], data[1][1][1]); @@ -274,9 +274,9 @@ MissingPointsTestCase.prototype.testCustomBarsWithMissingPoints = function() { p0 = g.toDomCoords(data[9][0], data[9][1][1]); p1 = g.toDomCoords(data[10][0], data[10][1][1]); CanvasAssertions.assertLineDrawn(htx, p0, p1, { strokeStyle: '#ff0000' }); -}; +}); -MissingPointsTestCase.prototype.testCustomBarsWithMissingPointsConnected = function() { +it('testCustomBarsWithMissingPointsConnected', function() { var data = [ [1, [1,null,1]], [2, [1,2,3]], @@ -298,7 +298,7 @@ MissingPointsTestCase.prototype.testCustomBarsWithMissingPointsConnected = funct var htx = g.hidden_ctx_; - assertEquals(2, CanvasAssertions.numLinesDrawn(htx, '#ff0000')); + assert.equal(2, CanvasAssertions.numLinesDrawn(htx, '#ff0000')); var p1 = g.toDomCoords(data[1][0], data[1][1][1]); var p2 = g.toDomCoords(data[3][0], data[3][1][1]); @@ -306,9 +306,9 @@ MissingPointsTestCase.prototype.testCustomBarsWithMissingPointsConnected = funct CanvasAssertions.assertConsecutiveLinesDrawn(htx, [p1, p2, p3], { strokeStyle: '#ff0000' }); -}; +}); -MissingPointsTestCase.prototype.testLeftBoundaryWithMisingPoints = function() { +it('testLeftBoundaryWithMisingPoints', function() { var data = [ [1, null, 3], [2, 1, null], @@ -327,26 +327,26 @@ MissingPointsTestCase.prototype.testLeftBoundaryWithMisingPoints = function() { } ); g.updateOptions({ dateWindow : [ 2.5, 4.5 ] }); - assertEquals(1, g.getLeftBoundary_(0)); - assertEquals(0, g.getLeftBoundary_(1)); + assert.equal(1, g.getLeftBoundary_(0)); + assert.equal(0, g.getLeftBoundary_(1)); var domX = g.toDomXCoord(1.9); var closestRow = g.findClosestRow(domX); - assertEquals(1, closestRow); + assert.equal(1, closestRow); g.setSelection(closestRow); - assertEquals(1, g.selPoints_.length); - assertEquals(1, g.selPoints_[0].yval); + assert.equal(1, g.selPoints_.length); + assert.equal(1, g.selPoints_[0].yval); g.setSelection(3); - assertEquals(2, g.selPoints_.length); - assertEquals(g.selPoints_[0].xval, g.selPoints_[1].xval); - assertEquals(2, g.selPoints_[0].yval); - assertEquals(1, g.selPoints_[1].yval); -}; + assert.equal(2, g.selPoints_.length); + assert.equal(g.selPoints_[0].xval, g.selPoints_[1].xval); + assert.equal(2, g.selPoints_[0].yval); + assert.equal(1, g.selPoints_[1].yval); +}); // Regression test for issue #411 -MissingPointsTestCase.prototype.testEmptySeries = function() { +it('testEmptySeries', function() { var graphDiv = document.getElementById("graph"); var g = new Dygraph( graphDiv, @@ -366,11 +366,11 @@ MissingPointsTestCase.prototype.testEmptySeries = function() { }); g.setSelection(6); - assertEquals("1381134466: Series 2: 94", Util.getLegend(graphDiv)); -}; + assert.equal("1381134466: Series 2: 94", Util.getLegend(graphDiv)); +}); // Regression test for issue #485 -MissingPointsTestCase.prototype.testMissingFill = function() { +it('testMissingFill', function() { var graphDiv = document.getElementById("graph"); var N = null; var g = new Dygraph( @@ -396,8 +396,10 @@ MissingPointsTestCase.prototype.testMissingFill = function() { var call = htx.calls__[i]; if ((call.name == 'moveTo' || call.name == 'lineTo') && call.args) { for (var j = 0; j < call.args.length; j++) { - assertFalse(isNaN(call.args[j])); + assert.isFalse(isNaN(call.args[j])); } } } -}; +}); + +}); diff --git a/auto_tests/tests/multi_csv.js b/auto_tests/tests/multi_csv.js index 764c402..c6b8d4f 100644 --- a/auto_tests/tests/multi_csv.js +++ b/auto_tests/tests/multi_csv.js @@ -3,14 +3,14 @@ * * @author dan@dygraphs.com (Dan Vanderkam) */ -var MultiCsvTestCase = TestCase("multi-csv"); +describe("multi-csv", function() { -MultiCsvTestCase.prototype.setUp = function() { +beforeEach(function() { document.body.innerHTML = "
"; -}; +}); -MultiCsvTestCase.prototype.tearDown = function() { -}; +afterEach(function() { +}); function getXLabels() { var x_labels = document.getElementsByClassName("dygraph-axis-label-x"); @@ -21,7 +21,7 @@ function getXLabels() { return ary; } -MultiCsvTestCase.prototype.testOneCSV = function() { +it('testOneCSV', function() { var opts = { width: 480, height: 320 @@ -36,10 +36,10 @@ MultiCsvTestCase.prototype.testOneCSV = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - assertEquals(['0', '1', '2'], getXLabels()); -}; + assert.deepEqual(['0', '1', '2'], getXLabels()); +}); -MultiCsvTestCase.prototype.testTwoCSV = function() { +it('testTwoCSV', function() { var opts = { width: 480, height: 320 @@ -54,9 +54,11 @@ MultiCsvTestCase.prototype.testTwoCSV = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - assertEquals(['0', '1', '2'], getXLabels()); + assert.deepEqual(['0', '1', '2'], getXLabels()); g.updateOptions({file: data}); - assertEquals(['0', '1', '2'], getXLabels()); -}; + assert.deepEqual(['0', '1', '2'], getXLabels()); +}); + +}); diff --git a/auto_tests/tests/multiple_axes.js b/auto_tests/tests/multiple_axes.js index a83b8f4..3935b52 100644 --- a/auto_tests/tests/multiple_axes.js +++ b/auto_tests/tests/multiple_axes.js @@ -4,11 +4,11 @@ * @author danvdk@gmail.com (Dan Vanderkam) */ -var MultipleAxesTestCase = TestCase("multiple-axes-tests"); +describe("multiple-axes-tests", function() { -MultipleAxesTestCase.prototype.setUp = function() { +beforeEach(function() { document.body.innerHTML = "
"; -}; +}); var getData = function() { var data = []; @@ -28,7 +28,7 @@ var getData = function() { return data; }; -MultipleAxesTestCase.prototype.testBasicMultipleAxes = function() { +it('testBasicMultipleAxes', function() { var data = getData(); var g = new Dygraph( @@ -55,11 +55,11 @@ MultipleAxesTestCase.prototype.testBasicMultipleAxes = function() { } ); - assertEquals(["0","20","40","60","80","100"], Util.getYLabels("1")); - assertEquals(["900K","1.12M","1.34M","1.55M","1.77M","1.99M"], Util.getYLabels("2")); -}; + assert.deepEqual(["0","20","40","60","80","100"], Util.getYLabels("1")); + assert.deepEqual(["900K","1.12M","1.34M","1.55M","1.77M","1.99M"], Util.getYLabels("2")); +}); -MultipleAxesTestCase.prototype.testTwoAxisVisibility = function() { +it('testTwoAxisVisibility', function() { var data = []; data.push([0,0,0]); data.push([1,2,2000]); @@ -83,24 +83,24 @@ MultipleAxesTestCase.prototype.testTwoAxisVisibility = function() { } ); - assertTrue(document.getElementsByClassName("dygraph-axis-label-y").length > 0); - assertTrue(document.getElementsByClassName("dygraph-axis-label-y2").length > 0); + assert.isTrue(document.getElementsByClassName("dygraph-axis-label-y").length > 0); + assert.isTrue(document.getElementsByClassName("dygraph-axis-label-y2").length > 0); g.setVisibility(0, false); - assertTrue(document.getElementsByClassName("dygraph-axis-label-y").length > 0); - assertTrue(document.getElementsByClassName("dygraph-axis-label-y2").length > 0); + assert.isTrue(document.getElementsByClassName("dygraph-axis-label-y").length > 0); + assert.isTrue(document.getElementsByClassName("dygraph-axis-label-y2").length > 0); g.setVisibility(0, true); g.setVisibility(1, false); - assertTrue(document.getElementsByClassName("dygraph-axis-label-y").length > 0); - assertTrue(document.getElementsByClassName("dygraph-axis-label-y2").length > 0); -}; + assert.isTrue(document.getElementsByClassName("dygraph-axis-label-y").length > 0); + assert.isTrue(document.getElementsByClassName("dygraph-axis-label-y2").length > 0); +}); // verifies that all four chart labels (title, x-, y-, y2-axis label) can be // used simultaneously. -MultipleAxesTestCase.prototype.testMultiChartLabels = function() { +it('testMultiChartLabels', function() { var data = getData(); var el = document.getElementById("graph"); @@ -130,19 +130,19 @@ MultipleAxesTestCase.prototype.testMultiChartLabels = function() { } ); - assertEquals(["Chart title", "x-axis", "y-axis", "y2-axis"], + assert.deepEqual(["Chart title", "x-axis", "y-axis", "y2-axis"], Util.getClassTexts("dygraph-label")); - assertEquals(["Chart title"], Util.getClassTexts("dygraph-title")); - assertEquals(["x-axis"], Util.getClassTexts("dygraph-xlabel")); - assertEquals(["y-axis"], Util.getClassTexts("dygraph-ylabel")); - assertEquals(["y2-axis"], Util.getClassTexts("dygraph-y2label")); + assert.deepEqual(["Chart title"], Util.getClassTexts("dygraph-title")); + assert.deepEqual(["x-axis"], Util.getClassTexts("dygraph-xlabel")); + assert.deepEqual(["y-axis"], Util.getClassTexts("dygraph-ylabel")); + assert.deepEqual(["y2-axis"], Util.getClassTexts("dygraph-y2label")); // TODO(danvk): check relative positioning here: title on top, y left of y2. -}; +}); // Check that a chart w/o a secondary y-axis will not get a y2label, even if one // is specified. -MultipleAxesTestCase.prototype.testNoY2LabelWithoutSecondaryAxis = function() { +it('testNoY2LabelWithoutSecondaryAxis', function() { var g = new Dygraph( document.getElementById("graph"), getData(), @@ -157,18 +157,18 @@ MultipleAxesTestCase.prototype.testNoY2LabelWithoutSecondaryAxis = function() { } ); - assertEquals(["Chart title", "x-axis", "y-axis"], + assert.deepEqual(["Chart title", "x-axis", "y-axis"], Util.getClassTexts("dygraph-label")); - assertEquals(["Chart title"], Util.getClassTexts("dygraph-title")); - assertEquals(["x-axis"], Util.getClassTexts("dygraph-xlabel")); - assertEquals(["y-axis"], Util.getClassTexts("dygraph-ylabel")); - assertEquals([], Util.getClassTexts("dygraph-y2label")); -}; + assert.deepEqual(["Chart title"], Util.getClassTexts("dygraph-title")); + assert.deepEqual(["x-axis"], Util.getClassTexts("dygraph-xlabel")); + assert.deepEqual(["y-axis"], Util.getClassTexts("dygraph-ylabel")); + assert.deepEqual([], Util.getClassTexts("dygraph-y2label")); +}); -MultipleAxesTestCase.prototype.testValueRangePerAxisOptions = function() { +it('testValueRangePerAxisOptions', function() { var data = getData(); - g = new Dygraph( + var g = new Dygraph( document.getElementById("graph"), data, { @@ -195,8 +195,8 @@ MultipleAxesTestCase.prototype.testValueRangePerAxisOptions = function() { y2label: 'Secondary y-axis', } ); - assertEquals(["40", "45", "50", "55", "60", "65"], Util.getYLabels("1")); - assertEquals(["900K","1.1M","1.3M","1.5M","1.7M","1.9M"], Util.getYLabels("2")); + assert.deepEqual(["40", "45", "50", "55", "60", "65"], Util.getYLabels("1")); + assert.deepEqual(["900K","1.1M","1.3M","1.5M","1.7M","1.9M"], Util.getYLabels("2")); g.updateOptions( { @@ -210,11 +210,11 @@ MultipleAxesTestCase.prototype.testValueRangePerAxisOptions = function() { } } ); - assertEquals(["40", "45", "50", "55", "60", "65", "70", "75"], Util.getYLabels("1")); - assertEquals(["1M", "1.02M", "1.05M", "1.08M", "1.1M", "1.13M", "1.15M", "1.18M"], Util.getYLabels("2")); -}; + assert.deepEqual(["40", "45", "50", "55", "60", "65", "70", "75"], Util.getYLabels("1")); + assert.deepEqual(["1M", "1.02M", "1.05M", "1.08M", "1.1M", "1.13M", "1.15M", "1.18M"], Util.getYLabels("2")); +}); -MultipleAxesTestCase.prototype.testDrawPointCallback = function() { +it('testDrawPointCallback', function() { var data = getData(); var results = { y : {}, y2 : {}}; @@ -228,7 +228,7 @@ MultipleAxesTestCase.prototype.testDrawPointCallback = function() { Dygraph.Circles.DEFAULT(g, seriesName, ctx, canvasx, canvasy, color, radius); }; - g = new Dygraph( + var g = new Dygraph( document.getElementById("graph"), data, { @@ -252,19 +252,19 @@ MultipleAxesTestCase.prototype.testDrawPointCallback = function() { } ); - assertEquals(1, results.y["Y1"]); - assertEquals(1, results.y["Y2"]); - assertEquals(1, results.y2["Y3"]); - assertEquals(1, results.y2["Y4"]); -}; + assert.equal(1, results.y["Y1"]); + assert.equal(1, results.y["Y2"]); + assert.equal(1, results.y2["Y3"]); + assert.equal(1, results.y2["Y4"]); +}); // Test for http://code.google.com/p/dygraphs/issues/detail?id=436 -MultipleAxesTestCase.prototype.testRemovingSecondAxis = function() { +it('testRemovingSecondAxis', function() { var data = getData(); var results = { y : {}, y2 : {}}; - g = new Dygraph( + var g = new Dygraph( document.getElementById("graph"), data, { @@ -280,4 +280,6 @@ MultipleAxesTestCase.prototype.testRemovingSecondAxis = function() { ); g.updateOptions({ series : { Y4 : { axis : 'y' } } }); -}; +}); + +}); diff --git a/auto_tests/tests/no_hours.js b/auto_tests/tests/no_hours.js index 1fde9ef..323c84e 100644 --- a/auto_tests/tests/no_hours.js +++ b/auto_tests/tests/no_hours.js @@ -5,16 +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() { +}); -noHoursTestCase.prototype.testNoHours = function() { +it('testNoHours', function() { var opts = { width: 480, height: 320 @@ -30,19 +30,19 @@ noHoursTestCase.prototype.testNoHours = function() { var g = new Dygraph(graph, data, opts); g.setSelection(0); - assertEquals("2012/03/13: Y: -1", Util.getLegend()); + assert.equal("2012/03/13: Y: -1", Util.getLegend()); g.setSelection(1); - assertEquals("2012/03/14: Y: 0", Util.getLegend()); + assert.equal("2012/03/14: Y: 0", Util.getLegend()); g.setSelection(2); - assertEquals("2012/03/15: Y: 1", Util.getLegend()); + assert.equal("2012/03/15: Y: 1", Util.getLegend()); g.setSelection(3); - assertEquals("2012/03/16: Y: 0", Util.getLegend()); -}; + assert.equal("2012/03/16: Y: 0", Util.getLegend()); +}); -noHoursTestCase.prototype.testNoHoursDashed = function() { +it('testNoHoursDashed', function() { var opts = { width: 480, height: 320 @@ -58,15 +58,17 @@ noHoursTestCase.prototype.testNoHoursDashed = function() { var g = new Dygraph(graph, data, opts); g.setSelection(0); - assertEquals("2012/03/13: Y: -1", Util.getLegend()); + assert.equal("2012/03/13: Y: -1", Util.getLegend()); g.setSelection(1); - assertEquals("2012/03/14: Y: 0", Util.getLegend()); + assert.equal("2012/03/14: Y: 0", Util.getLegend()); g.setSelection(2); - assertEquals("2012/03/15: Y: 1", Util.getLegend()); + assert.equal("2012/03/15: Y: 1", Util.getLegend()); g.setSelection(3); - assertEquals("2012/03/16: Y: 0", Util.getLegend()); -}; + assert.equal("2012/03/16: Y: 0", Util.getLegend()); +}); + +}); diff --git a/auto_tests/tests/numeric_ticker.js b/auto_tests/tests/numeric_ticker.js index da29e09..f1af342 100644 --- a/auto_tests/tests/numeric_ticker.js +++ b/auto_tests/tests/numeric_ticker.js @@ -6,11 +6,11 @@ * @author danvdk@gmail.com (Dan Vanderkam) */ -var NumericTickerTestCase = TestCase("numeric-ticker-tests"); +describe("numeric-ticker-tests", function() { -NumericTickerTestCase.prototype.setUp = function() { +beforeEach(function() { document.body.innerHTML = "
"; -}; +}); var createOptionsViewForAxis = function(axis, dict) { return function (x) { @@ -28,7 +28,7 @@ var createOptionsViewForAxis = function(axis, dict) { }; }; -NumericTickerTestCase.prototype.testBasicNumericTicker = function() { +it('testBasicNumericTicker', function() { var opts = {"logscale":null,"labelsKMG2":false,"labelsKMB":false}; var options = createOptionsViewForAxis('y', opts); @@ -45,7 +45,7 @@ NumericTickerTestCase.prototype.testBasicNumericTicker = function() { {"v":3.5,"label":"3.5"}, {"v":4,"label":"4"}, {"v":4.5,"label":"4.5"}]; - assertEquals(expected_ticks, ticks); + assert.equal(expected_ticks, ticks); ticks = Dygraph.numericTicks(1, 84, 540, options); var expected_ticks = [ @@ -68,122 +68,124 @@ NumericTickerTestCase.prototype.testBasicNumericTicker = function() { {"v":80,"label":"80"}, {"v":85,"label":"85"} ]; - assertEquals(expected_ticks, ticks); -}; + assert.equal(expected_ticks, ticks); +}); /* -NumericTickerTestCase.prototype.testAllNumericTickers = function() { - assertEquals([{"v":-0.5,"label":"-0.5"},{"v":0,"label":"0"},{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"}], Dygraph.numericTicks(-0.4, 4.4, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":-1.5,"label":"-1.5"},{"v":-1,"label":"-1"},{"v":-0.5,"label":"-0.5"},{"v":0,"label":"0"},{"v":0.5,"label":"0.5"},{"v":1,"label":"1"}], Dygraph.numericTicks(-1.4157430939856124, 1.4157430939856124, 400, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":-10,"label":"-10"},{"v":-8,"label":"-8"},{"v":-6,"label":"-6"},{"v":-4,"label":"-4"},{"v":-2,"label":"-2"},{"v":0,"label":"0"},{"v":2,"label":"2"},{"v":4,"label":"4"},{"v":6,"label":"6"},{"v":8,"label":"8"}], Dygraph.numericTicks(-10, 9.98046875, 400, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":-200,"label":"-200"},{"v":0,"label":"0"},{"v":200,"label":"200"},{"v":400,"label":"400"},{"v":600,"label":"600"},{"v":800,"label":"800"},{"v":-17999000,"label":"1000"}], Dygraph.numericTicks(-101.10000000000001, 1100.1, 300, createOptionsViewForAxis('y',{"logscale":false,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":-20,"label":"-20"},{"v":-10,"label":"-10"},{"v":0,"label":"0"},{"v":10,"label":"10"},{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"}], Dygraph.numericTicks(-11.687459005175139, 42.287459005175144, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":-15,"label":"-15"},{"v":-10,"label":"-10"},{"v":-5,"label":"-5"},{"v":0,"label":"0"},{"v":5,"label":"5"},{"v":10,"label":"10"}], Dygraph.numericTicks(-12, 12, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":-15,"label":"-15"},{"v":-10,"label":"-10"},{"v":-5,"label":"-5"},{"v":0,"label":"0"},{"v":5,"label":"5"},{"v":10,"label":"10"}], Dygraph.numericTicks(-13.19792086872138, 13.197062407353386, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":-220,"label":"-220"},{"v":-200,"label":"-200"},{"v":-180,"label":"-180"},{"v":-160,"label":"-160"},{"v":-140,"label":"-140"},{"v":-120,"label":"-120"}], Dygraph.numericTicks(-220, -100, 200, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":-40,"label":"-40"},{"v":-20,"label":"-20"},{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"},{"v":120,"label":"120"}], Dygraph.numericTicks(-32.8, 132.8, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":-40,"label":"-40"},{"v":-30,"label":"-30"},{"v":-20,"label":"-20"},{"v":-10,"label":"-10"},{"v":0,"label":"0"},{"v":10,"label":"10"},{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"}], Dygraph.numericTicks(-34.309, 89.279, 400, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":-60,"label":"-60"},{"v":-40,"label":"-40"},{"v":-20,"label":"-20"},{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"}], Dygraph.numericTicks(-60, 60, 200, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":-60,"label":"-60"},{"v":-40,"label":"-40"},{"v":-20,"label":"-20"},{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"}], Dygraph.numericTicks(-60, 60, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":0.0001,"label":"1.00e-4"},{"v":0.0002,"label":"2.00e-4"},{"v":-17999999,"label":"3.00e-4"},{"v":0.0004,"label":"4.00e-4"},{"v":0.0005,"label":"5.00e-4"}], Dygraph.numericTicks(0, 0.00055, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":0},{"v":0.0001,"label":0.0001},{"v":0.0002,"label":0.0002},{"v":-17999999,"label":0.0003},{"v":0.0004,"label":0.0004},{"v":0.0005,"label":0.0005}], Dygraph.numericTicks(0, 0.00055, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":0.2,"label":"0.2"},{"v":0.4,"label":"0.4"},{"v":-17999999,"label":"0.6"},{"v":0.8,"label":"0.8"}], Dygraph.numericTicks(0, 1, 200, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":0.2,"label":"0.2"},{"v":0.4,"label":"0.4"},{"v":-17999999,"label":"0.6"},{"v":0.8,"label":"0.8"}], Dygraph.numericTicks(0, 1, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":0.1,"label":"0.1"},{"v":0.2,"label":"0.2"},{"v":-17999999,"label":"0.3"},{"v":0.4,"label":"0.4"},{"v":0.5,"label":"0.5"},{"v":-17999999,"label":"0.6"},{"v":-17999999,"label":"0.7"},{"v":0.8,"label":"0.8"},{"v":0.9,"label":"0.9"},{"v":1,"label":"1"},{"v":1.1,"label":"1.1"},{"v":-17999998,"label":"1.2"}], Dygraph.numericTicks(0, 1.2, 400, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":10,"label":"10"},{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"}], Dygraph.numericTicks(0, 100, 400, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"}], Dygraph.numericTicks(0, 104.53192180924043, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"}], Dygraph.numericTicks(0, 109.9856877755916, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":2,"label":"2"},{"v":4,"label":"4"},{"v":6,"label":"6"},{"v":8,"label":"8"},{"v":10,"label":"10"}], Dygraph.numericTicks(0, 11, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"}], Dygraph.numericTicks(0, 110, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"}], Dygraph.numericTicks(0, 110, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":10,"label":"10"},{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"},{"v":100,"label":"100"}], Dygraph.numericTicks(0, 110, 350, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":200,"label":"200"},{"v":400,"label":"400"},{"v":600,"label":"600"},{"v":800,"label":"800"},{"v":-17999000,"label":"1000"}], Dygraph.numericTicks(0, 1100, 300, createOptionsViewForAxis('y',{"logscale":false,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":-17000000,"label":"1M"},{"v":-16000000,"label":"2M"},{"v":-15000000,"label":"3M"},{"v":-14000000,"label":"4M"},{"v":-13000000,"label":"5M"},{"v":-12000000,"label":"6M"},{"v":-11000000,"label":"7M"},{"v":-10000000,"label":"8M"},{"v":-9000000,"label":"9M"},{"v":-8000000,"label":"10M"}], Dygraph.numericTicks(0, 11000000, 480, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":true}))); - assertEquals([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"}], Dygraph.numericTicks(0, 119, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"},{"v":120,"label":"120"}], Dygraph.numericTicks(0, 130.9, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"},{"v":120,"label":"120"}], Dygraph.numericTicks(0, 131, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":-17998000,"label":"2000"},{"v":-17996000,"label":"4000"},{"v":-17994000,"label":"6000"},{"v":-17992000,"label":"8000"},{"v":-17990000,"label":"10000"},{"v":-17988000,"label":"12000"},{"v":-17986000,"label":"14000"},{"v":-17984000,"label":"16000"}], Dygraph.numericTicks(0, 16977.4, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"}], Dygraph.numericTicks(0, 2, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":0.2,"label":"0.2"},{"v":0.4,"label":"0.4"},{"v":-17999999,"label":"0.6"},{"v":0.8,"label":"0.8"},{"v":1,"label":"1"},{"v":-17999998,"label":"1.2"},{"v":-17999998,"label":"1.4"},{"v":1.6,"label":"1.6"},{"v":1.8,"label":"1.8"}], Dygraph.numericTicks(0, 2, 400, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"}], Dygraph.numericTicks(0, 2.2, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":-17800000,"label":"200K"},{"v":-17600000,"label":"400K"},{"v":-17400000,"label":"600K"},{"v":-17200000,"label":"800K"},{"v":-17000000,"label":"1M"},{"v":-16800000,"label":"1.2M"},{"v":-16600000,"label":"1.4M"},{"v":-16400000,"label":"1.6M"},{"v":-16200000,"label":"1.8M"},{"v":-16000000,"label":"2M"}], Dygraph.numericTicks(0, 2200000, 350, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":true}))); - assertEquals([{"v":0,"label":"0"},{"v":50,"label":"50"},{"v":100,"label":"100"},{"v":150,"label":"150"},{"v":200,"label":"200"}], Dygraph.numericTicks(0, 249, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":500,"label":"500"},{"v":-17999000,"label":"1000"},{"v":1500,"label":"1500"},{"v":-17998000,"label":"2000"},{"v":2500,"label":"2500"}], Dygraph.numericTicks(0, 2747.9970998900817, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":200,"label":"200"},{"v":400,"label":"400"},{"v":600,"label":"600"},{"v":800,"label":"800"},{"v":-17999000,"label":"1K"},{"v":1200,"label":"1.2K"},{"v":1400,"label":"1.4K"},{"v":1600,"label":"1.6K"},{"v":1800,"label":"1.8K"},{"v":-17998000,"label":"2K"},{"v":2200,"label":"2.2K"},{"v":2400,"label":"2.4K"},{"v":2600,"label":"2.6K"}], Dygraph.numericTicks(0, 2747.9970998900817, 480, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":true}))); - assertEquals([{"v":0,"label":"0"},{"v":5,"label":"5"},{"v":10,"label":"10"},{"v":15,"label":"15"},{"v":20,"label":"20"},{"v":25,"label":"25"},{"v":30,"label":"30"}], Dygraph.numericTicks(0, 32.698942321287205, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":-17500000,"label":"500000"},{"v":-17000000,"label":"1.00e+6"},{"v":-16500000,"label":"1.50e+6"},{"v":-16000000,"label":"2.00e+6"},{"v":-15500000,"label":"2.50e+6"},{"v":-15000000,"label":"3.00e+6"}], Dygraph.numericTicks(0, 3263100.6418021005, 480, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":5,"label":"5"},{"v":10,"label":"10"},{"v":15,"label":"15"},{"v":20,"label":"20"},{"v":25,"label":"25"},{"v":30,"label":"30"}], Dygraph.numericTicks(0, 33.16213467701236, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"}], Dygraph.numericTicks(0, 4, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"}], Dygraph.numericTicks(0, 4.4, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":5,"label":"5"},{"v":10,"label":"10"},{"v":15,"label":"15"},{"v":20,"label":"20"},{"v":25,"label":"25"},{"v":30,"label":"30"},{"v":35,"label":"35"},{"v":40,"label":"40"}], Dygraph.numericTicks(0, 42, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":true}))); - assertEquals([{"v":0,"label":"0"},{"v":8,"label":"8"},{"v":16,"label":"16"},{"v":24,"label":"24"},{"v":32,"label":"32"},{"v":40,"label":"40"}], Dygraph.numericTicks(0, 42, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":true,"labelsKMB":false}))); - assertEquals([{"v":0,"label":0},{"v":8,"label":8},{"v":16,"label":16},{"v":24,"label":24},{"v":32,"label":32},{"v":40,"label":40}], Dygraph.numericTicks(0, 42, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":true,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":999982000000,"label":"1T"},{"v":1999982000000,"label":"2T"},{"v":2999982000000,"label":"3T"},{"v":3999982000000,"label":"4T"}], Dygraph.numericTicks(0, 4837851162214.3, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":true}))); - assertEquals([{"v":0,"label":"0"},{"v":549755813888,"label":"512G"},{"v":1099511627776,"label":"1T"},{"v":1649267441664,"label":"1.5T"},{"v":2199023255552,"label":"2T"},{"v":2748779069440,"label":"2.5T"},{"v":3298534883328,"label":"3T"},{"v":3848290697216,"label":"3.5T"},{"v":4398046511104,"label":"4T"}], Dygraph.numericTicks(0, 4837851162214.3, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":true,"labelsKMB":false}))); - assertEquals([{"v":0,"label":0},{"v":549755813888,"label":"512G"},{"v":1099511627776,"label":"1T"},{"v":1649267441664,"label":"1.5T"},{"v":2199023255552,"label":"2T"},{"v":2748779069440,"label":"2.5T"},{"v":3298534883328,"label":"3T"},{"v":3848290697216,"label":"3.5T"},{"v":4398046511104,"label":"4T"}], Dygraph.numericTicks(0, 4837851162214.3, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":true,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":-17999000,"label":"1000"},{"v":-17998000,"label":"2000"},{"v":-17997000,"label":"3000"},{"v":-17996000,"label":"4000"},{"v":-17995000,"label":"5000"}], Dygraph.numericTicks(0, 5451.6, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":100,"label":"100"},{"v":200,"label":"200"},{"v":300,"label":"300"},{"v":400,"label":"400"},{"v":500,"label":"500"}], Dygraph.numericTicks(0, 550, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":10,"label":"10"},{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"}], Dygraph.numericTicks(0, 64.9, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":100,"label":"100"},{"v":200,"label":"200"},{"v":300,"label":"300"},{"v":400,"label":"400"},{"v":500,"label":"500"},{"v":600,"label":"600"}], Dygraph.numericTicks(0, 667.9, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"},{"v":6,"label":"6"},{"v":7,"label":"7"}], Dygraph.numericTicks(0, 7.7, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"},{"v":6,"label":"6"},{"v":7,"label":"7"}], Dygraph.numericTicks(0, 7.9347329768293005, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":10,"label":"10"},{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"}], Dygraph.numericTicks(0, 72.6, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"}], Dygraph.numericTicks(0, 99, 200, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"}], Dygraph.numericTicks(0, 99, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":10,"label":"10"},{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"}], Dygraph.numericTicks(0, 99, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":200,"label":"200"},{"v":400,"label":"400"},{"v":600,"label":"600"},{"v":800,"label":"800"}], Dygraph.numericTicks(0, 999, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0.000001,"label":"1.00e-6"},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":"1.00e-5"},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":0.0001,"label":"1.00e-4"},{"v":0.0002,"label":""},{"v":-17999999,"label":""},{"v":0.0004,"label":""},{"v":0.0005,"label":""},{"v":-17999999,"label":""},{"v":0.0007,"label":""},{"v":0.0008,"label":""},{"v":-17999999,"label":""},{"v":0.001,"label":"1.00e-3"},{"v":0.002,"label":""},{"v":0.003,"label":""},{"v":0.004,"label":""},{"v":0.005,"label":""},{"v":0.006,"label":""},{"v":0.007,"label":""},{"v":0.008,"label":""},{"v":-17999999,"label":""},{"v":0.01,"label":"0.01"},{"v":0.02,"label":""},{"v":0.03,"label":""},{"v":0.04,"label":""},{"v":0.05,"label":""},{"v":0.06,"label":""},{"v":0.07,"label":""},{"v":0.08,"label":""},{"v":0.09,"label":""},{"v":0.1,"label":"0.1"},{"v":0.2,"label":""},{"v":-17999999,"label":""},{"v":0.4,"label":""},{"v":0.5,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":0.8,"label":""},{"v":0.9,"label":""},{"v":1,"label":"1"},{"v":2,"label":""},{"v":3,"label":""},{"v":4,"label":""},{"v":5,"label":""},{"v":6,"label":""},{"v":7,"label":""},{"v":8,"label":""},{"v":9,"label":""},{"v":10,"label":"10"},{"v":20,"label":""},{"v":30,"label":""},{"v":40,"label":""},{"v":50,"label":""},{"v":60,"label":""},{"v":70,"label":""},{"v":80,"label":""},{"v":90,"label":""},{"v":100,"label":"100"},{"v":200,"label":""},{"v":300,"label":""},{"v":400,"label":""},{"v":500,"label":""},{"v":600,"label":""},{"v":700,"label":""},{"v":800,"label":""},{"v":900,"label":""},{"v":-17999000,"label":"1000"}], Dygraph.numericTicks(0.000001, 1099.9999999, 300, createOptionsViewForAxis('y',{"logscale":true,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"}], Dygraph.numericTicks(0.6, 5.4, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"},{"v":4.5,"label":"4.5"}], Dygraph.numericTicks(0.6373123361267239, 4.824406504982038, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"},{"v":4.5,"label":"4.5"}], Dygraph.numericTicks(0.6373123361267239, 4.824406504982038, 353, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0.6000000000000001,"label":"0.6"},{"v":0.8,"label":"0.8"},{"v":1,"label":"1"},{"v":-17999998,"label":"1.2"},{"v":-17999998,"label":"1.4"},{"v":1.6,"label":"1.6"},{"v":-17999998,"label":"1.8"},{"v":2,"label":"2"},{"v":2.2,"label":"2.2"},{"v":-17999997,"label":"2.4"},{"v":2.6,"label":"2.6"},{"v":-17999997,"label":"2.8"},{"v":-17999997,"label":"3"},{"v":3.2,"label":"3.2"},{"v":-17999996,"label":"3.4"},{"v":3.6,"label":"3.6"},{"v":-17999996,"label":"3.8"},{"v":4,"label":"4"},{"v":4.2,"label":"4.2"},{"v":4.4,"label":"4.4"},{"v":4.6,"label":"4.6"},{"v":-17999995,"label":"4.8"}], Dygraph.numericTicks(0.6373123361267239, 4.824406504982038, 743, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"},{"v":4.5,"label":"4.5"}], Dygraph.numericTicks(0.6386658954698001, 4.8095173522082, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"}], Dygraph.numericTicks(0.7101014279158788, 4.023726495301334, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"}], Dygraph.numericTicks(1, 109, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"}], Dygraph.numericTicks(1, 3, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"}], Dygraph.numericTicks(1, 4, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"}], Dygraph.numericTicks(1, 4, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"},{"v":4.5,"label":"4.5"}], Dygraph.numericTicks(1, 5, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":1,"label":1},{"v":1.5,"label":1.5},{"v":2,"label":2},{"v":2.5,"label":2.5},{"v":3,"label":3},{"v":3.5,"label":3.5},{"v":4,"label":4},{"v":4.5,"label":4.5}], Dygraph.numericTicks(1, 5, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"}], Dygraph.numericTicks(1, 6, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"},{"v":6,"label":"6"}], Dygraph.numericTicks(1, 7, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"},{"v":6,"label":"6"},{"v":7,"label":"7"},{"v":8,"label":"8"}], Dygraph.numericTicks(1, 9, 300, createOptionsViewForAxis('y',{"logscale":false,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"},{"v":6,"label":""},{"v":7,"label":"7"},{"v":8,"label":""},{"v":9,"label":"9"}], Dygraph.numericTicks(1, 9, 300, createOptionsViewForAxis('y',{"logscale":true,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"},{"v":6,"label":"6"},{"v":7,"label":"7"},{"v":8,"label":"8"}], Dygraph.numericTicks(1, 9, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":2,"label":"2"},{"v":4,"label":"4"},{"v":6,"label":"6"},{"v":8,"label":"8"},{"v":10,"label":"10"}], Dygraph.numericTicks(1.2, 10.8, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"},{"v":4.5,"label":"4.5"}], Dygraph.numericTicks(1.2872947778969237, 4.765317192093838, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"},{"v":6,"label":"6"},{"v":7,"label":"7"}], Dygraph.numericTicks(1.5, 7.5, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":5,"label":"5"},{"v":10,"label":"10"},{"v":15,"label":"15"},{"v":20,"label":"20"},{"v":25,"label":"25"}], Dygraph.numericTicks(1.7999999999999998, 28.2, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":10,"label":"10"},{"v":10.1,"label":"10.1"},{"v":10.2,"label":"10.2"},{"v":10.3,"label":"10.3"},{"v":10.4,"label":"10.4"},{"v":10.5,"label":"10.5"},{"v":10.6,"label":"10.6"},{"v":10.7,"label":"10.7"},{"v":10.8,"label":"10.8"},{"v":10.9,"label":"10.9"}], Dygraph.numericTicks(10, 11, 480, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":100,"label":"100"},{"v":120,"label":"120"},{"v":140,"label":"140"},{"v":160,"label":"160"},{"v":180,"label":"180"}], Dygraph.numericTicks(100, 200, 200, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":10000,"label":"10000"},{"v":-17988000,"label":"12000"},{"v":-17986000,"label":"14000"},{"v":-17984000,"label":"16000"},{"v":-17982000,"label":"18000"},{"v":-17980000,"label":"20000"},{"v":-17978000,"label":"22000"},{"v":-17976000,"label":"24000"},{"v":-17974000,"label":"26000"},{"v":-17972000,"label":"28000"},{"v":-17970000,"label":"30000"},{"v":-17968000,"label":"32000"},{"v":-17966000,"label":"34000"},{"v":-17964000,"label":"36000"}], Dygraph.numericTicks(10122.8, 36789.2, 480, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":11000,"label":"11000"},{"v":11200,"label":"11200"},{"v":11400,"label":"11400"},{"v":11600,"label":"11600"},{"v":11800,"label":"11800"},{"v":-17988000,"label":"12000"},{"v":12200,"label":"12200"},{"v":12400,"label":"12400"},{"v":12600,"label":"12600"},{"v":12800,"label":"12800"},{"v":-17987000,"label":"13000"},{"v":13200,"label":"13200"},{"v":13400,"label":"13400"}], Dygraph.numericTicks(11110.5, 13579.5, 480, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":162000,"label":"162000"},{"v":-17836000,"label":"164000"},{"v":-17834000,"label":"166000"},{"v":-17832000,"label":"168000"},{"v":-17830000,"label":"170000"},{"v":-17828000,"label":"172000"},{"v":-17826000,"label":"174000"},{"v":-17824000,"label":"176000"},{"v":-17822000,"label":"178000"}], Dygraph.numericTicks(163038.4, 179137.6, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"}], Dygraph.numericTicks(2, 4, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"},{"v":6,"label":"6"},{"v":7,"label":"7"}], Dygraph.numericTicks(2.6, 7.4, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"}], Dygraph.numericTicks(21.7, 97.3, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"}], Dygraph.numericTicks(21.7, 97.3, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"}], Dygraph.numericTicks(24, 96, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"}], Dygraph.numericTicks(26.185714285714287, 90.81428571428572, 20, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"}], Dygraph.numericTicks(26.185714285714287, 90.81428571428572, 200, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false,pixelsPerLabel:20}))); - assertEquals([{"v":25,"label":"25"},{"v":30,"label":"30"},{"v":35,"label":"35"},{"v":40,"label":"40"},{"v":45,"label":"45"},{"v":50,"label":"50"},{"v":55,"label":"55"},{"v":60,"label":"60"},{"v":65,"label":"65"},{"v":70,"label":"70"},{"v":75,"label":"75"},{"v":80,"label":"80"},{"v":85,"label":"85"},{"v":90,"label":"90"}], Dygraph.numericTicks(26.185714285714287, 90.81428571428572, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false,pixelsPerLabel:20}))); - assertEquals([{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"}], Dygraph.numericTicks(26.185714285714287, 90.81428571428572, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"}], Dygraph.numericTicks(28.33333333333333, 88.33333333333334, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"},{"v":4.5,"label":"4.5"}], Dygraph.numericTicks(3, 5, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":3000,"label":"3K"},{"v":2500,"label":"2.5K"},{"v":-17998000,"label":"2K"},{"v":1500,"label":"1.5K"},{"v":-17999000,"label":"1K"},{"v":500,"label":"500"}], Dygraph.numericTicks(3000, 0, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":true}))); - assertEquals([{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"}], Dygraph.numericTicks(33.11333333333334, 83.75333333333333, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"}], Dygraph.numericTicks(36.921241050119335, 88.32696897374701, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":50,"label":""},{"v":60,"label":"60"},{"v":70,"label":""},{"v":80,"label":""},{"v":90,"label":""},{"v":100,"label":"100"},{"v":200,"label":""},{"v":300,"label":"300"},{"v":400,"label":""},{"v":500,"label":""},{"v":600,"label":"600"},{"v":700,"label":""},{"v":800,"label":""},{"v":900,"label":""},{"v":-17999000,"label":"1000"},{"v":-17998000,"label":""},{"v":-17997000,"label":"3000"},{"v":-17996000,"label":""},{"v":-17995000,"label":""},{"v":-17994000,"label":"6000"},{"v":-17993000,"label":""},{"v":-17992000,"label":""},{"v":-17991000,"label":""},{"v":-17990000,"label":"10000"}], Dygraph.numericTicks(41.220000000000084, 15576.828000000018, 400, createOptionsViewForAxis('y',{"logscale":true,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"}], Dygraph.numericTicks(44.5, 98.5, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":5,"label":"5"},{"v":6,"label":""},{"v":7,"label":""},{"v":8,"label":""},{"v":9,"label":""},{"v":10,"label":"10"},{"v":20,"label":"20"},{"v":30,"label":""},{"v":40,"label":""},{"v":50,"label":"50"},{"v":60,"label":""},{"v":70,"label":""},{"v":80,"label":""},{"v":90,"label":""},{"v":100,"label":"100"},{"v":200,"label":"200"},{"v":300,"label":""},{"v":400,"label":""},{"v":500,"label":"500"},{"v":600,"label":""},{"v":700,"label":""},{"v":800,"label":""},{"v":900,"label":""},{"v":-17999000,"label":"1000"}], Dygraph.numericTicks(5, 1099.5, 300, createOptionsViewForAxis('y',{"logscale":true,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":50,"label":"50"},{"v":55,"label":"55"},{"v":60,"label":"60"},{"v":65,"label":"65"},{"v":70,"label":"70"},{"v":75,"label":"75"},{"v":80,"label":"80"}], Dygraph.numericTicks(52.5, 82.5, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":68,"label":"68"},{"v":70,"label":"70"},{"v":72,"label":"72"},{"v":74,"label":"74"},{"v":76,"label":"76"},{"v":78,"label":"78"},{"v":80,"label":"80"}], Dygraph.numericTicks(69, 81, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":-17980000,"label":"20K"},{"v":-17960000,"label":"40K"},{"v":-17940000,"label":"60K"},{"v":-17920000,"label":"80K"}], Dygraph.numericTicks(7921.099999999999, 81407.9, 240, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":true}))); - assertEquals([{"v":8,"label":"8"},{"v":10,"label":"10"},{"v":12,"label":"12"},{"v":14,"label":"14"},{"v":16,"label":"16"},{"v":18,"label":"18"},{"v":20,"label":"20"}], Dygraph.numericTicks(9, 21, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":8,"label":"8"},{"v":10,"label":"10"},{"v":12,"label":"12"},{"v":14,"label":"14"},{"v":16,"label":"16"},{"v":18,"label":"18"},{"v":20,"label":"20"}], Dygraph.numericTicks(9, 21, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":9,"label":"9"},{"v":10,"label":"10"},{"v":11,"label":"11"},{"v":12,"label":"12"},{"v":13,"label":"13"},{"v":14,"label":"14"},{"v":15,"label":"15"},{"v":16,"label":"16"},{"v":17,"label":"17"},{"v":18,"label":"18"}], Dygraph.numericTicks(9.2, 18.8, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":80,"label":"80"},{"v":100,"label":"100"},{"v":120,"label":"120"},{"v":140,"label":"140"},{"v":160,"label":"160"},{"v":180,"label":"180"},{"v":200,"label":"200"}], Dygraph.numericTicks(90, 210, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":true}))); - assertEquals([{"v":95,"label":"95"},{"v":96,"label":"96"},{"v":97,"label":"97"},{"v":98,"label":"98"},{"v":99,"label":"99"},{"v":100,"label":"100"},{"v":101,"label":"101"},{"v":102,"label":"102"},{"v":103,"label":"103"},{"v":104,"label":"104"}], Dygraph.numericTicks(95.71121718377088, 104.23150357995226, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":950,"label":"950"},{"v":-17999000,"label":"1000"},{"v":1050,"label":"1050"},{"v":1100,"label":"1100"},{"v":1150,"label":"1150"},{"v":1200,"label":"1200"}], Dygraph.numericTicks(980.1, 1218.9, 200, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); -}; +it('testAllNumericTickers', function() { + assert.deepEqual([{"v":-0.5,"label":"-0.5"},{"v":0,"label":"0"},{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"}], Dygraph.numericTicks(-0.4, 4.4, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":-1.5,"label":"-1.5"},{"v":-1,"label":"-1"},{"v":-0.5,"label":"-0.5"},{"v":0,"label":"0"},{"v":0.5,"label":"0.5"},{"v":1,"label":"1"}], Dygraph.numericTicks(-1.4157430939856124, 1.4157430939856124, 400, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":-10,"label":"-10"},{"v":-8,"label":"-8"},{"v":-6,"label":"-6"},{"v":-4,"label":"-4"},{"v":-2,"label":"-2"},{"v":0,"label":"0"},{"v":2,"label":"2"},{"v":4,"label":"4"},{"v":6,"label":"6"},{"v":8,"label":"8"}], Dygraph.numericTicks(-10, 9.98046875, 400, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":-200,"label":"-200"},{"v":0,"label":"0"},{"v":200,"label":"200"},{"v":400,"label":"400"},{"v":600,"label":"600"},{"v":800,"label":"800"},{"v":-17999000,"label":"1000"}], Dygraph.numericTicks(-101.10000000000001, 1100.1, 300, createOptionsViewForAxis('y',{"logscale":false,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":-20,"label":"-20"},{"v":-10,"label":"-10"},{"v":0,"label":"0"},{"v":10,"label":"10"},{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"}], Dygraph.numericTicks(-11.687459005175139, 42.287459005175144, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":-15,"label":"-15"},{"v":-10,"label":"-10"},{"v":-5,"label":"-5"},{"v":0,"label":"0"},{"v":5,"label":"5"},{"v":10,"label":"10"}], Dygraph.numericTicks(-12, 12, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":-15,"label":"-15"},{"v":-10,"label":"-10"},{"v":-5,"label":"-5"},{"v":0,"label":"0"},{"v":5,"label":"5"},{"v":10,"label":"10"}], Dygraph.numericTicks(-13.19792086872138, 13.197062407353386, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":-220,"label":"-220"},{"v":-200,"label":"-200"},{"v":-180,"label":"-180"},{"v":-160,"label":"-160"},{"v":-140,"label":"-140"},{"v":-120,"label":"-120"}], Dygraph.numericTicks(-220, -100, 200, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":-40,"label":"-40"},{"v":-20,"label":"-20"},{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"},{"v":120,"label":"120"}], Dygraph.numericTicks(-32.8, 132.8, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":-40,"label":"-40"},{"v":-30,"label":"-30"},{"v":-20,"label":"-20"},{"v":-10,"label":"-10"},{"v":0,"label":"0"},{"v":10,"label":"10"},{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"}], Dygraph.numericTicks(-34.309, 89.279, 400, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":-60,"label":"-60"},{"v":-40,"label":"-40"},{"v":-20,"label":"-20"},{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"}], Dygraph.numericTicks(-60, 60, 200, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":-60,"label":"-60"},{"v":-40,"label":"-40"},{"v":-20,"label":"-20"},{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"}], Dygraph.numericTicks(-60, 60, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":0.0001,"label":"1.00e-4"},{"v":0.0002,"label":"2.00e-4"},{"v":-17999999,"label":"3.00e-4"},{"v":0.0004,"label":"4.00e-4"},{"v":0.0005,"label":"5.00e-4"}], Dygraph.numericTicks(0, 0.00055, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":0},{"v":0.0001,"label":0.0001},{"v":0.0002,"label":0.0002},{"v":-17999999,"label":0.0003},{"v":0.0004,"label":0.0004},{"v":0.0005,"label":0.0005}], Dygraph.numericTicks(0, 0.00055, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":0.2,"label":"0.2"},{"v":0.4,"label":"0.4"},{"v":-17999999,"label":"0.6"},{"v":0.8,"label":"0.8"}], Dygraph.numericTicks(0, 1, 200, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":0.2,"label":"0.2"},{"v":0.4,"label":"0.4"},{"v":-17999999,"label":"0.6"},{"v":0.8,"label":"0.8"}], Dygraph.numericTicks(0, 1, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":0.1,"label":"0.1"},{"v":0.2,"label":"0.2"},{"v":-17999999,"label":"0.3"},{"v":0.4,"label":"0.4"},{"v":0.5,"label":"0.5"},{"v":-17999999,"label":"0.6"},{"v":-17999999,"label":"0.7"},{"v":0.8,"label":"0.8"},{"v":0.9,"label":"0.9"},{"v":1,"label":"1"},{"v":1.1,"label":"1.1"},{"v":-17999998,"label":"1.2"}], Dygraph.numericTicks(0, 1.2, 400, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":10,"label":"10"},{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"}], Dygraph.numericTicks(0, 100, 400, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"}], Dygraph.numericTicks(0, 104.53192180924043, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"}], Dygraph.numericTicks(0, 109.9856877755916, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":2,"label":"2"},{"v":4,"label":"4"},{"v":6,"label":"6"},{"v":8,"label":"8"},{"v":10,"label":"10"}], Dygraph.numericTicks(0, 11, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"}], Dygraph.numericTicks(0, 110, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"}], Dygraph.numericTicks(0, 110, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":10,"label":"10"},{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"},{"v":100,"label":"100"}], Dygraph.numericTicks(0, 110, 350, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":200,"label":"200"},{"v":400,"label":"400"},{"v":600,"label":"600"},{"v":800,"label":"800"},{"v":-17999000,"label":"1000"}], Dygraph.numericTicks(0, 1100, 300, createOptionsViewForAxis('y',{"logscale":false,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":-17000000,"label":"1M"},{"v":-16000000,"label":"2M"},{"v":-15000000,"label":"3M"},{"v":-14000000,"label":"4M"},{"v":-13000000,"label":"5M"},{"v":-12000000,"label":"6M"},{"v":-11000000,"label":"7M"},{"v":-10000000,"label":"8M"},{"v":-9000000,"label":"9M"},{"v":-8000000,"label":"10M"}], Dygraph.numericTicks(0, 11000000, 480, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":true}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"}], Dygraph.numericTicks(0, 119, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"},{"v":120,"label":"120"}], Dygraph.numericTicks(0, 130.9, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"},{"v":120,"label":"120"}], Dygraph.numericTicks(0, 131, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":-17998000,"label":"2000"},{"v":-17996000,"label":"4000"},{"v":-17994000,"label":"6000"},{"v":-17992000,"label":"8000"},{"v":-17990000,"label":"10000"},{"v":-17988000,"label":"12000"},{"v":-17986000,"label":"14000"},{"v":-17984000,"label":"16000"}], Dygraph.numericTicks(0, 16977.4, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"}], Dygraph.numericTicks(0, 2, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":0.2,"label":"0.2"},{"v":0.4,"label":"0.4"},{"v":-17999999,"label":"0.6"},{"v":0.8,"label":"0.8"},{"v":1,"label":"1"},{"v":-17999998,"label":"1.2"},{"v":-17999998,"label":"1.4"},{"v":1.6,"label":"1.6"},{"v":1.8,"label":"1.8"}], Dygraph.numericTicks(0, 2, 400, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"}], Dygraph.numericTicks(0, 2.2, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":-17800000,"label":"200K"},{"v":-17600000,"label":"400K"},{"v":-17400000,"label":"600K"},{"v":-17200000,"label":"800K"},{"v":-17000000,"label":"1M"},{"v":-16800000,"label":"1.2M"},{"v":-16600000,"label":"1.4M"},{"v":-16400000,"label":"1.6M"},{"v":-16200000,"label":"1.8M"},{"v":-16000000,"label":"2M"}], Dygraph.numericTicks(0, 2200000, 350, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":true}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":50,"label":"50"},{"v":100,"label":"100"},{"v":150,"label":"150"},{"v":200,"label":"200"}], Dygraph.numericTicks(0, 249, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":500,"label":"500"},{"v":-17999000,"label":"1000"},{"v":1500,"label":"1500"},{"v":-17998000,"label":"2000"},{"v":2500,"label":"2500"}], Dygraph.numericTicks(0, 2747.9970998900817, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":200,"label":"200"},{"v":400,"label":"400"},{"v":600,"label":"600"},{"v":800,"label":"800"},{"v":-17999000,"label":"1K"},{"v":1200,"label":"1.2K"},{"v":1400,"label":"1.4K"},{"v":1600,"label":"1.6K"},{"v":1800,"label":"1.8K"},{"v":-17998000,"label":"2K"},{"v":2200,"label":"2.2K"},{"v":2400,"label":"2.4K"},{"v":2600,"label":"2.6K"}], Dygraph.numericTicks(0, 2747.9970998900817, 480, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":true}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":5,"label":"5"},{"v":10,"label":"10"},{"v":15,"label":"15"},{"v":20,"label":"20"},{"v":25,"label":"25"},{"v":30,"label":"30"}], Dygraph.numericTicks(0, 32.698942321287205, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":-17500000,"label":"500000"},{"v":-17000000,"label":"1.00e+6"},{"v":-16500000,"label":"1.50e+6"},{"v":-16000000,"label":"2.00e+6"},{"v":-15500000,"label":"2.50e+6"},{"v":-15000000,"label":"3.00e+6"}], Dygraph.numericTicks(0, 3263100.6418021005, 480, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":5,"label":"5"},{"v":10,"label":"10"},{"v":15,"label":"15"},{"v":20,"label":"20"},{"v":25,"label":"25"},{"v":30,"label":"30"}], Dygraph.numericTicks(0, 33.16213467701236, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"}], Dygraph.numericTicks(0, 4, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"}], Dygraph.numericTicks(0, 4.4, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":5,"label":"5"},{"v":10,"label":"10"},{"v":15,"label":"15"},{"v":20,"label":"20"},{"v":25,"label":"25"},{"v":30,"label":"30"},{"v":35,"label":"35"},{"v":40,"label":"40"}], Dygraph.numericTicks(0, 42, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":true}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":8,"label":"8"},{"v":16,"label":"16"},{"v":24,"label":"24"},{"v":32,"label":"32"},{"v":40,"label":"40"}], Dygraph.numericTicks(0, 42, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":true,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":0},{"v":8,"label":8},{"v":16,"label":16},{"v":24,"label":24},{"v":32,"label":32},{"v":40,"label":40}], Dygraph.numericTicks(0, 42, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":true,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":999982000000,"label":"1T"},{"v":1999982000000,"label":"2T"},{"v":2999982000000,"label":"3T"},{"v":3999982000000,"label":"4T"}], Dygraph.numericTicks(0, 4837851162214.3, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":true}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":549755813888,"label":"512G"},{"v":1099511627776,"label":"1T"},{"v":1649267441664,"label":"1.5T"},{"v":2199023255552,"label":"2T"},{"v":2748779069440,"label":"2.5T"},{"v":3298534883328,"label":"3T"},{"v":3848290697216,"label":"3.5T"},{"v":4398046511104,"label":"4T"}], Dygraph.numericTicks(0, 4837851162214.3, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":true,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":0},{"v":549755813888,"label":"512G"},{"v":1099511627776,"label":"1T"},{"v":1649267441664,"label":"1.5T"},{"v":2199023255552,"label":"2T"},{"v":2748779069440,"label":"2.5T"},{"v":3298534883328,"label":"3T"},{"v":3848290697216,"label":"3.5T"},{"v":4398046511104,"label":"4T"}], Dygraph.numericTicks(0, 4837851162214.3, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":true,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":-17999000,"label":"1000"},{"v":-17998000,"label":"2000"},{"v":-17997000,"label":"3000"},{"v":-17996000,"label":"4000"},{"v":-17995000,"label":"5000"}], Dygraph.numericTicks(0, 5451.6, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":100,"label":"100"},{"v":200,"label":"200"},{"v":300,"label":"300"},{"v":400,"label":"400"},{"v":500,"label":"500"}], Dygraph.numericTicks(0, 550, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":10,"label":"10"},{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"}], Dygraph.numericTicks(0, 64.9, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":100,"label":"100"},{"v":200,"label":"200"},{"v":300,"label":"300"},{"v":400,"label":"400"},{"v":500,"label":"500"},{"v":600,"label":"600"}], Dygraph.numericTicks(0, 667.9, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"},{"v":6,"label":"6"},{"v":7,"label":"7"}], Dygraph.numericTicks(0, 7.7, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"},{"v":6,"label":"6"},{"v":7,"label":"7"}], Dygraph.numericTicks(0, 7.9347329768293005, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":10,"label":"10"},{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"}], Dygraph.numericTicks(0, 72.6, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"}], Dygraph.numericTicks(0, 99, 200, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"}], Dygraph.numericTicks(0, 99, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":10,"label":"10"},{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"}], Dygraph.numericTicks(0, 99, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":200,"label":"200"},{"v":400,"label":"400"},{"v":600,"label":"600"},{"v":800,"label":"800"}], Dygraph.numericTicks(0, 999, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0.000001,"label":"1.00e-6"},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":"1.00e-5"},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":0.0001,"label":"1.00e-4"},{"v":0.0002,"label":""},{"v":-17999999,"label":""},{"v":0.0004,"label":""},{"v":0.0005,"label":""},{"v":-17999999,"label":""},{"v":0.0007,"label":""},{"v":0.0008,"label":""},{"v":-17999999,"label":""},{"v":0.001,"label":"1.00e-3"},{"v":0.002,"label":""},{"v":0.003,"label":""},{"v":0.004,"label":""},{"v":0.005,"label":""},{"v":0.006,"label":""},{"v":0.007,"label":""},{"v":0.008,"label":""},{"v":-17999999,"label":""},{"v":0.01,"label":"0.01"},{"v":0.02,"label":""},{"v":0.03,"label":""},{"v":0.04,"label":""},{"v":0.05,"label":""},{"v":0.06,"label":""},{"v":0.07,"label":""},{"v":0.08,"label":""},{"v":0.09,"label":""},{"v":0.1,"label":"0.1"},{"v":0.2,"label":""},{"v":-17999999,"label":""},{"v":0.4,"label":""},{"v":0.5,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":0.8,"label":""},{"v":0.9,"label":""},{"v":1,"label":"1"},{"v":2,"label":""},{"v":3,"label":""},{"v":4,"label":""},{"v":5,"label":""},{"v":6,"label":""},{"v":7,"label":""},{"v":8,"label":""},{"v":9,"label":""},{"v":10,"label":"10"},{"v":20,"label":""},{"v":30,"label":""},{"v":40,"label":""},{"v":50,"label":""},{"v":60,"label":""},{"v":70,"label":""},{"v":80,"label":""},{"v":90,"label":""},{"v":100,"label":"100"},{"v":200,"label":""},{"v":300,"label":""},{"v":400,"label":""},{"v":500,"label":""},{"v":600,"label":""},{"v":700,"label":""},{"v":800,"label":""},{"v":900,"label":""},{"v":-17999000,"label":"1000"}], Dygraph.numericTicks(0.000001, 1099.9999999, 300, createOptionsViewForAxis('y',{"logscale":true,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"}], Dygraph.numericTicks(0.6, 5.4, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"},{"v":4.5,"label":"4.5"}], Dygraph.numericTicks(0.6373123361267239, 4.824406504982038, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"},{"v":4.5,"label":"4.5"}], Dygraph.numericTicks(0.6373123361267239, 4.824406504982038, 353, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0.6000000000000001,"label":"0.6"},{"v":0.8,"label":"0.8"},{"v":1,"label":"1"},{"v":-17999998,"label":"1.2"},{"v":-17999998,"label":"1.4"},{"v":1.6,"label":"1.6"},{"v":-17999998,"label":"1.8"},{"v":2,"label":"2"},{"v":2.2,"label":"2.2"},{"v":-17999997,"label":"2.4"},{"v":2.6,"label":"2.6"},{"v":-17999997,"label":"2.8"},{"v":-17999997,"label":"3"},{"v":3.2,"label":"3.2"},{"v":-17999996,"label":"3.4"},{"v":3.6,"label":"3.6"},{"v":-17999996,"label":"3.8"},{"v":4,"label":"4"},{"v":4.2,"label":"4.2"},{"v":4.4,"label":"4.4"},{"v":4.6,"label":"4.6"},{"v":-17999995,"label":"4.8"}], Dygraph.numericTicks(0.6373123361267239, 4.824406504982038, 743, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"},{"v":4.5,"label":"4.5"}], Dygraph.numericTicks(0.6386658954698001, 4.8095173522082, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"}], Dygraph.numericTicks(0.7101014279158788, 4.023726495301334, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"}], Dygraph.numericTicks(1, 109, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"}], Dygraph.numericTicks(1, 3, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"}], Dygraph.numericTicks(1, 4, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"}], Dygraph.numericTicks(1, 4, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"},{"v":4.5,"label":"4.5"}], Dygraph.numericTicks(1, 5, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":1,"label":1},{"v":1.5,"label":1.5},{"v":2,"label":2},{"v":2.5,"label":2.5},{"v":3,"label":3},{"v":3.5,"label":3.5},{"v":4,"label":4},{"v":4.5,"label":4.5}], Dygraph.numericTicks(1, 5, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"}], Dygraph.numericTicks(1, 6, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"},{"v":6,"label":"6"}], Dygraph.numericTicks(1, 7, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"},{"v":6,"label":"6"},{"v":7,"label":"7"},{"v":8,"label":"8"}], Dygraph.numericTicks(1, 9, 300, createOptionsViewForAxis('y',{"logscale":false,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"},{"v":6,"label":""},{"v":7,"label":"7"},{"v":8,"label":""},{"v":9,"label":"9"}], Dygraph.numericTicks(1, 9, 300, createOptionsViewForAxis('y',{"logscale":true,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"},{"v":6,"label":"6"},{"v":7,"label":"7"},{"v":8,"label":"8"}], Dygraph.numericTicks(1, 9, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":2,"label":"2"},{"v":4,"label":"4"},{"v":6,"label":"6"},{"v":8,"label":"8"},{"v":10,"label":"10"}], Dygraph.numericTicks(1.2, 10.8, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"},{"v":4.5,"label":"4.5"}], Dygraph.numericTicks(1.2872947778969237, 4.765317192093838, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"},{"v":6,"label":"6"},{"v":7,"label":"7"}], Dygraph.numericTicks(1.5, 7.5, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":5,"label":"5"},{"v":10,"label":"10"},{"v":15,"label":"15"},{"v":20,"label":"20"},{"v":25,"label":"25"}], Dygraph.numericTicks(1.7999999999999998, 28.2, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":10,"label":"10"},{"v":10.1,"label":"10.1"},{"v":10.2,"label":"10.2"},{"v":10.3,"label":"10.3"},{"v":10.4,"label":"10.4"},{"v":10.5,"label":"10.5"},{"v":10.6,"label":"10.6"},{"v":10.7,"label":"10.7"},{"v":10.8,"label":"10.8"},{"v":10.9,"label":"10.9"}], Dygraph.numericTicks(10, 11, 480, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":100,"label":"100"},{"v":120,"label":"120"},{"v":140,"label":"140"},{"v":160,"label":"160"},{"v":180,"label":"180"}], Dygraph.numericTicks(100, 200, 200, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":10000,"label":"10000"},{"v":-17988000,"label":"12000"},{"v":-17986000,"label":"14000"},{"v":-17984000,"label":"16000"},{"v":-17982000,"label":"18000"},{"v":-17980000,"label":"20000"},{"v":-17978000,"label":"22000"},{"v":-17976000,"label":"24000"},{"v":-17974000,"label":"26000"},{"v":-17972000,"label":"28000"},{"v":-17970000,"label":"30000"},{"v":-17968000,"label":"32000"},{"v":-17966000,"label":"34000"},{"v":-17964000,"label":"36000"}], Dygraph.numericTicks(10122.8, 36789.2, 480, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":11000,"label":"11000"},{"v":11200,"label":"11200"},{"v":11400,"label":"11400"},{"v":11600,"label":"11600"},{"v":11800,"label":"11800"},{"v":-17988000,"label":"12000"},{"v":12200,"label":"12200"},{"v":12400,"label":"12400"},{"v":12600,"label":"12600"},{"v":12800,"label":"12800"},{"v":-17987000,"label":"13000"},{"v":13200,"label":"13200"},{"v":13400,"label":"13400"}], Dygraph.numericTicks(11110.5, 13579.5, 480, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":162000,"label":"162000"},{"v":-17836000,"label":"164000"},{"v":-17834000,"label":"166000"},{"v":-17832000,"label":"168000"},{"v":-17830000,"label":"170000"},{"v":-17828000,"label":"172000"},{"v":-17826000,"label":"174000"},{"v":-17824000,"label":"176000"},{"v":-17822000,"label":"178000"}], Dygraph.numericTicks(163038.4, 179137.6, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"}], Dygraph.numericTicks(2, 4, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"},{"v":6,"label":"6"},{"v":7,"label":"7"}], Dygraph.numericTicks(2.6, 7.4, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"}], Dygraph.numericTicks(21.7, 97.3, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"}], Dygraph.numericTicks(21.7, 97.3, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"}], Dygraph.numericTicks(24, 96, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"}], Dygraph.numericTicks(26.185714285714287, 90.81428571428572, 20, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"}], Dygraph.numericTicks(26.185714285714287, 90.81428571428572, 200, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false,pixelsPerLabel:20}))); + assert.deepEqual([{"v":25,"label":"25"},{"v":30,"label":"30"},{"v":35,"label":"35"},{"v":40,"label":"40"},{"v":45,"label":"45"},{"v":50,"label":"50"},{"v":55,"label":"55"},{"v":60,"label":"60"},{"v":65,"label":"65"},{"v":70,"label":"70"},{"v":75,"label":"75"},{"v":80,"label":"80"},{"v":85,"label":"85"},{"v":90,"label":"90"}], Dygraph.numericTicks(26.185714285714287, 90.81428571428572, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false,pixelsPerLabel:20}))); + assert.deepEqual([{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"}], Dygraph.numericTicks(26.185714285714287, 90.81428571428572, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"}], Dygraph.numericTicks(28.33333333333333, 88.33333333333334, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"},{"v":4.5,"label":"4.5"}], Dygraph.numericTicks(3, 5, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":3000,"label":"3K"},{"v":2500,"label":"2.5K"},{"v":-17998000,"label":"2K"},{"v":1500,"label":"1.5K"},{"v":-17999000,"label":"1K"},{"v":500,"label":"500"}], Dygraph.numericTicks(3000, 0, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":true}))); + assert.deepEqual([{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"}], Dygraph.numericTicks(33.11333333333334, 83.75333333333333, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"}], Dygraph.numericTicks(36.921241050119335, 88.32696897374701, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":50,"label":""},{"v":60,"label":"60"},{"v":70,"label":""},{"v":80,"label":""},{"v":90,"label":""},{"v":100,"label":"100"},{"v":200,"label":""},{"v":300,"label":"300"},{"v":400,"label":""},{"v":500,"label":""},{"v":600,"label":"600"},{"v":700,"label":""},{"v":800,"label":""},{"v":900,"label":""},{"v":-17999000,"label":"1000"},{"v":-17998000,"label":""},{"v":-17997000,"label":"3000"},{"v":-17996000,"label":""},{"v":-17995000,"label":""},{"v":-17994000,"label":"6000"},{"v":-17993000,"label":""},{"v":-17992000,"label":""},{"v":-17991000,"label":""},{"v":-17990000,"label":"10000"}], Dygraph.numericTicks(41.220000000000084, 15576.828000000018, 400, createOptionsViewForAxis('y',{"logscale":true,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"}], Dygraph.numericTicks(44.5, 98.5, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":5,"label":"5"},{"v":6,"label":""},{"v":7,"label":""},{"v":8,"label":""},{"v":9,"label":""},{"v":10,"label":"10"},{"v":20,"label":"20"},{"v":30,"label":""},{"v":40,"label":""},{"v":50,"label":"50"},{"v":60,"label":""},{"v":70,"label":""},{"v":80,"label":""},{"v":90,"label":""},{"v":100,"label":"100"},{"v":200,"label":"200"},{"v":300,"label":""},{"v":400,"label":""},{"v":500,"label":"500"},{"v":600,"label":""},{"v":700,"label":""},{"v":800,"label":""},{"v":900,"label":""},{"v":-17999000,"label":"1000"}], Dygraph.numericTicks(5, 1099.5, 300, createOptionsViewForAxis('y',{"logscale":true,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":50,"label":"50"},{"v":55,"label":"55"},{"v":60,"label":"60"},{"v":65,"label":"65"},{"v":70,"label":"70"},{"v":75,"label":"75"},{"v":80,"label":"80"}], Dygraph.numericTicks(52.5, 82.5, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":68,"label":"68"},{"v":70,"label":"70"},{"v":72,"label":"72"},{"v":74,"label":"74"},{"v":76,"label":"76"},{"v":78,"label":"78"},{"v":80,"label":"80"}], Dygraph.numericTicks(69, 81, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":0,"label":"0"},{"v":-17980000,"label":"20K"},{"v":-17960000,"label":"40K"},{"v":-17940000,"label":"60K"},{"v":-17920000,"label":"80K"}], Dygraph.numericTicks(7921.099999999999, 81407.9, 240, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":true}))); + assert.deepEqual([{"v":8,"label":"8"},{"v":10,"label":"10"},{"v":12,"label":"12"},{"v":14,"label":"14"},{"v":16,"label":"16"},{"v":18,"label":"18"},{"v":20,"label":"20"}], Dygraph.numericTicks(9, 21, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":8,"label":"8"},{"v":10,"label":"10"},{"v":12,"label":"12"},{"v":14,"label":"14"},{"v":16,"label":"16"},{"v":18,"label":"18"},{"v":20,"label":"20"}], Dygraph.numericTicks(9, 21, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":9,"label":"9"},{"v":10,"label":"10"},{"v":11,"label":"11"},{"v":12,"label":"12"},{"v":13,"label":"13"},{"v":14,"label":"14"},{"v":15,"label":"15"},{"v":16,"label":"16"},{"v":17,"label":"17"},{"v":18,"label":"18"}], Dygraph.numericTicks(9.2, 18.8, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":80,"label":"80"},{"v":100,"label":"100"},{"v":120,"label":"120"},{"v":140,"label":"140"},{"v":160,"label":"160"},{"v":180,"label":"180"},{"v":200,"label":"200"}], Dygraph.numericTicks(90, 210, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":true}))); + assert.deepEqual([{"v":95,"label":"95"},{"v":96,"label":"96"},{"v":97,"label":"97"},{"v":98,"label":"98"},{"v":99,"label":"99"},{"v":100,"label":"100"},{"v":101,"label":"101"},{"v":102,"label":"102"},{"v":103,"label":"103"},{"v":104,"label":"104"}], Dygraph.numericTicks(95.71121718377088, 104.23150357995226, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assert.deepEqual([{"v":950,"label":"950"},{"v":-17999000,"label":"1000"},{"v":1050,"label":"1050"},{"v":1100,"label":"1100"},{"v":1150,"label":"1150"},{"v":1200,"label":"1200"}], Dygraph.numericTicks(980.1, 1218.9, 200, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); +}); */ + +}); diff --git a/auto_tests/tests/parser.js b/auto_tests/tests/parser.js index dc1d5b2..55df841 100644 --- a/auto_tests/tests/parser.js +++ b/auto_tests/tests/parser.js @@ -3,23 +3,23 @@ * * @author danvk@google.com (Dan Vanderkam) */ -var parserTestCase = TestCase("parser"); +describe("parser", function() { -parserTestCase.prototype.setUp = function() { +beforeEach(function() { document.body.innerHTML = "
"; -}; +}); -parserTestCase.prototype.tearDown = function() { -}; +afterEach(function() { +}); -parserTestCase.prototype.testDetectLineDelimiter = function() { +it('testDetectLineDelimiter', function() { var data = "X,Y\r" + "0,-1\r" + "1,0\r" + "2,1\r" + "3,0\r" ; - assertEquals("\r", Dygraph.detectLineDelimiter(data)); + assert.equal("\r", Dygraph.detectLineDelimiter(data)); data = "X,Y\n" + "0,-1\n" + @@ -27,7 +27,7 @@ parserTestCase.prototype.testDetectLineDelimiter = function() { "2,1\n" + "3,0\n" ; - assertEquals("\n", Dygraph.detectLineDelimiter(data)); + assert.equal("\n", Dygraph.detectLineDelimiter(data)); data = "X,Y\n\r" + "0,-1\n\r" + @@ -35,10 +35,10 @@ parserTestCase.prototype.testDetectLineDelimiter = function() { "2,1\n\r" + "3,0\n\r" ; - assertEquals("\n\r", Dygraph.detectLineDelimiter(data)); -}; + assert.equal("\n\r", Dygraph.detectLineDelimiter(data)); +}); -parserTestCase.prototype.testParseDosNewlines = function() { +it('testParseDosNewlines', function() { var opts = { width: 480, height: 320 @@ -53,10 +53,12 @@ parserTestCase.prototype.testParseDosNewlines = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - assertEquals(0, g.getValue(0, 0)); - assertEquals(-1, g.getValue(0, 1)); - assertEquals(1, g.getValue(1, 0)); - assertEquals(0, g.getValue(1, 1)); - assertEquals(['X', 'Y'], g.getLabels()); -}; + assert.equal(0, g.getValue(0, 0)); + assert.equal(-1, g.getValue(0, 1)); + assert.equal(1, g.getValue(1, 0)); + assert.equal(0, g.getValue(1, 1)); + assert.deepEqual(['X', 'Y'], g.getLabels()); +}); + +}); diff --git a/auto_tests/tests/pathological_cases.js b/auto_tests/tests/pathological_cases.js index 985241f..ade714c 100644 --- a/auto_tests/tests/pathological_cases.js +++ b/auto_tests/tests/pathological_cases.js @@ -4,16 +4,16 @@ * * @author dan@dygraphs.com (Dan Vanderkam) */ -var pathologicalCasesTestCase = TestCase("pathological-cases"); +describe("pathological-cases", function() { -pathologicalCasesTestCase.prototype.setUp = function() { +beforeEach(function() { document.body.innerHTML = "
"; -}; +}); -pathologicalCasesTestCase.prototype.tearDown = function() { -}; +afterEach(function() { +}); -pathologicalCasesTestCase.prototype.testZeroPoint = function() { +it('testZeroPoint', function() { var opts = { width: 480, height: 320 @@ -22,9 +22,9 @@ pathologicalCasesTestCase.prototype.testZeroPoint = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); -}; +}); -pathologicalCasesTestCase.prototype.testOnePoint = function() { +it('testOnePoint', function() { var opts = { width: 480, height: 320 @@ -34,9 +34,9 @@ pathologicalCasesTestCase.prototype.testOnePoint = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); -}; +}); -pathologicalCasesTestCase.prototype.testCombinations = function() { +it('testCombinations', function() { var dataSets = { empty: [], onePoint: [[10, 2]], @@ -114,9 +114,9 @@ pathologicalCasesTestCase.prototype.testCombinations = function() { } } } -}; +}); -pathologicalCasesTestCase.prototype.testNullLegend = function() { +it('testNullLegend', function() { var opts = { width: 480, height: 320, @@ -127,35 +127,37 @@ pathologicalCasesTestCase.prototype.testNullLegend = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); -}; +}); -pathologicalCasesTestCase.prototype.testDivAsString = function() { +it('testDivAsString', function() { var data = "X,Y\n" + "1,2\n"; var g = new Dygraph('graph', data, {}); -}; +}); -pathologicalCasesTestCase.prototype.testConstantSeriesNegative = function() { +it('testConstantSeriesNegative', function() { var data = "X,Y\n" + "1,-1\n" + "2,-1\n"; - g = new Dygraph('graph', data, {}); + var g = new Dygraph('graph', data, {}); // This check could be loosened to // g.yAxisRange()[0] < g.yAxisRange()[1] if it breaks in the future. - assertEquals([-1.1, -0.9], g.yAxisRange()); -}; + assert.deepEqual([-1.1, -0.9], g.yAxisRange()); +}); -pathologicalCasesTestCase.prototype.testConstantSeriesNegativeIncludeZero = function() { +it('testConstantSeriesNegativeIncludeZero', function() { var data = "X,Y\n" + "1,-1\n" + "2,-1\n"; - g = new Dygraph('graph', data, {includeZero: true}); + var g = new Dygraph('graph', data, {includeZero: true}); // This check could be loosened to // g.yAxisRange()[0] < g.yAxisRange()[1] if it breaks in the future. - assertEquals([-1.1, 0], g.yAxisRange()); -}; + assert.deepEqual([-1.1, 0], g.yAxisRange()); +}); + +}); diff --git a/auto_tests/tests/per_axis.js b/auto_tests/tests/per_axis.js index a3bdbad..4ae6208 100644 --- a/auto_tests/tests/per_axis.js +++ b/auto_tests/tests/per_axis.js @@ -3,7 +3,7 @@ * * @author konigsberg@google.com (Robert Konigsberg) */ -var perAxisTestCase = TestCase("per-axis"); +describe("per-axis", function() { var _origGetContext = Dygraph.getContext; @@ -12,7 +12,7 @@ var yAxisLineColor = "#ffff00"; var g, graph; -perAxisTestCase.prototype.setUp = function() { +beforeEach(function() { document.body.innerHTML = "
"; Dygraph.getContext = function(canvas) { return new Proxy(_origGetContext(canvas)); @@ -40,34 +40,36 @@ perAxisTestCase.prototype.setUp = function() { ; graph = document.getElementById('graph'); g = new Dygraph(graph, data, opts); -}; +}); -perAxisTestCase.prototype.tearDown = function() { +afterEach(function() { Dygraph.getContext = _origGetContext; -}; +}); -perAxisTestCase.prototype.testDrawXAxis = function() { +it('testDrawXAxis', function() { g.updateOptions({ axes : { x : { drawAxis: true }} }); - assertTrue(graph.getElementsByClassName('dygraph-axis-label-x').length > 0); - assertTrue(graph.getElementsByClassName('dygraph-axis-label-y').length == 0); -} + assert.isTrue(graph.getElementsByClassName('dygraph-axis-label-x').length > 0); + assert.isTrue(graph.getElementsByClassName('dygraph-axis-label-y').length == 0); +}); -perAxisTestCase.prototype.testDrawYAxis = function() { +it('testDrawYAxis', function() { g.updateOptions({ axes : { y : { drawAxis: true }} }); - assertTrue(graph.getElementsByClassName('dygraph-axis-label-x').length ==0); - assertTrue(graph.getElementsByClassName('dygraph-axis-label-y').length > 0); -} + assert.isTrue(graph.getElementsByClassName('dygraph-axis-label-x').length ==0); + assert.isTrue(graph.getElementsByClassName('dygraph-axis-label-y').length > 0); +}); -perAxisTestCase.prototype.testDrawXGrid = function() { +it('testDrawXGrid', function() { g.updateOptions({ axes : { x : { drawGrid : true }}}); var htx = g.hidden_ctx_; - assertTrue(CanvasAssertions.numLinesDrawn(htx, xAxisLineColor) > 0); - assertTrue(CanvasAssertions.numLinesDrawn(htx, yAxisLineColor) == 0); -} + assert.isTrue(CanvasAssertions.numLinesDrawn(htx, xAxisLineColor) > 0); + assert.isTrue(CanvasAssertions.numLinesDrawn(htx, yAxisLineColor) == 0); +}); -perAxisTestCase.prototype.testDrawYGrid = function() { +it('testDrawYGrid', function() { g.updateOptions({ axes : { y : { drawGrid : true }}}); var htx = g.hidden_ctx_; - assertTrue(CanvasAssertions.numLinesDrawn(htx, xAxisLineColor) == 0); - assertTrue(CanvasAssertions.numLinesDrawn(htx, yAxisLineColor) > 0); -} + assert.isTrue(CanvasAssertions.numLinesDrawn(htx, xAxisLineColor) == 0); + assert.isTrue(CanvasAssertions.numLinesDrawn(htx, yAxisLineColor) > 0); +}); + +}); diff --git a/auto_tests/tests/per_series.js b/auto_tests/tests/per_series.js index b1b672e..a09f912 100644 --- a/auto_tests/tests/per_series.js +++ b/auto_tests/tests/per_series.js @@ -3,16 +3,16 @@ * * @author danvk@google.com (Dan Vanderkam) */ -var perSeriesTestCase = TestCase("per-series"); +describe("per-series", function() { -perSeriesTestCase.prototype.setUp = function() { +beforeEach(function() { document.body.innerHTML = "
"; -}; +}); -perSeriesTestCase.prototype.tearDown = function() { -}; +afterEach(function() { +}); -perSeriesTestCase.prototype.testPerSeriesFill = function() { +it('testPerSeriesFill', function() { var opts = { width: 480, height: 320, @@ -44,18 +44,18 @@ perSeriesTestCase.prototype.testPerSeriesFill = function() { ; var graph = document.getElementById("graph"); - g = new Dygraph(graph, data, opts); + var g = new Dygraph(graph, data, opts); var sampler = new PixelSampler(g); // Inside of the "Z" bump -- no fill. - assertEquals([0,0,0,0], sampler.colorAtCoordinate(2.5, 0.5)); + assert.deepEqual([0,0,0,0], sampler.colorAtCoordinate(2.5, 0.5)); // Inside of the "Y" bump -- filled in. - assertEquals([255,0,0,38], sampler.colorAtCoordinate(6.5, 0.5)); -}; + assert.deepEqual([255,0,0,38], sampler.colorAtCoordinate(6.5, 0.5)); +}); -perSeriesTestCase.prototype.testNewStyleSeries = function() { +it('testNewStyleSeries', function() { var opts = { pointSize : 5, series : { @@ -64,15 +64,15 @@ perSeriesTestCase.prototype.testNewStyleSeries = function() { }; var graph = document.getElementById("graph"); var data = "X,Y,Z\n1,0,0\n"; - g = new Dygraph(graph, data, opts); + var g = new Dygraph(graph, data, opts); - assertEquals(5, g.getOption("pointSize")); - assertEquals(4, g.getOption("pointSize", "Y")); - assertEquals(5, g.getOption("pointSize", "Z")); -}; + assert.equal(5, g.getOption("pointSize")); + assert.equal(4, g.getOption("pointSize", "Y")); + assert.equal(5, g.getOption("pointSize", "Z")); +}); // TODO(konigsberg): move to multiple_axes.js -perSeriesTestCase.prototype.testAxisInNewSeries = function() { +it('testAxisInNewSeries', function() { var opts = { series : { D : { axis : 'y2' }, @@ -83,14 +83,14 @@ perSeriesTestCase.prototype.testAxisInNewSeries = function() { }; var graph = document.getElementById("graph"); var data = "X,A,B,C,D,E\n0,1,2,3,4,5\n"; - g = new Dygraph(graph, data, opts); + var g = new Dygraph(graph, data, opts); - assertEquals(["A", "B", "E"], g.attributes_.seriesForAxis(0)); - assertEquals(["C", "D"], g.attributes_.seriesForAxis(1)); -}; + assert.deepEqual(["A", "B", "E"], g.attributes_.seriesForAxis(0)); + assert.deepEqual(["C", "D"], g.attributes_.seriesForAxis(1)); +}); // TODO(konigsberg): move to multiple_axes.js -perSeriesTestCase.prototype.testAxisInNewSeries_withAxes = function() { +it('testAxisInNewSeries_withAxes', function() { var opts = { series : { D : { axis : 'y2' }, @@ -105,21 +105,21 @@ perSeriesTestCase.prototype.testAxisInNewSeries_withAxes = function() { }; var graph = document.getElementById("graph"); var data = "X,A,B,C,D,E\n0,1,2,3,4,5\n"; - g = new Dygraph(graph, data, opts); + var g = new Dygraph(graph, data, opts); - assertEquals(["A", "B", "E"], g.attributes_.seriesForAxis(0)); - assertEquals(["C", "D"], g.attributes_.seriesForAxis(1)); + assert.deepEqual(["A", "B", "E"], g.attributes_.seriesForAxis(0)); + assert.deepEqual(["C", "D"], g.attributes_.seriesForAxis(1)); - assertEquals(1.5, g.getOption("pointSize")); - assertEquals(7, g.getOption("pointSize", "A")); - assertEquals(7, g.getOption("pointSize", "B")); - assertEquals(6, g.getOption("pointSize", "C")); - assertEquals(6, g.getOption("pointSize", "D")); - assertEquals(7, g.getOption("pointSize", "E")); -}; + assert.equal(1.5, g.getOption("pointSize")); + assert.equal(7, g.getOption("pointSize", "A")); + assert.equal(7, g.getOption("pointSize", "B")); + assert.equal(6, g.getOption("pointSize", "C")); + assert.equal(6, g.getOption("pointSize", "D")); + assert.equal(7, g.getOption("pointSize", "E")); +}); // TODO(konigsberg): move to multiple_axes.js -perSeriesTestCase.prototype.testOldAxisSpecInNewSeriesThrows = function() { +it('testOldAxisSpecInNewSeriesThrows', function() { var opts = { series : { D : { axis : {} }, @@ -134,14 +134,16 @@ perSeriesTestCase.prototype.testOldAxisSpecInNewSeriesThrows = function() { threw = true; } - assertTrue(threw); -} + assert.isTrue(threw); +}); -perSeriesTestCase.prototype.testColorOption = function() { +it('testColorOption', function() { var graph = document.getElementById("graph"); var data = "X,A,B,C\n0,1,2,3\n"; var g = new Dygraph(graph, data, {}); - assertEquals(['rgb(64,128,0)', 'rgb(64,0,128)', 'rgb(0,128,128)'], g.getColors()); + assert.deepEqual(['rgb(64,128,0)', 'rgb(64,0,128)', 'rgb(0,128,128)'], g.getColors()); g.updateOptions({series : { B : { color : 'purple' }}}); - assertEquals(['rgb(64,128,0)', 'purple', 'rgb(0,128,128)'], g.getColors()); -} + assert.deepEqual(['rgb(64,128,0)', 'purple', 'rgb(0,128,128)'], g.getColors()); +}); + +}); diff --git a/auto_tests/tests/plugins.js b/auto_tests/tests/plugins.js index ee3e940..1abccd4 100644 --- a/auto_tests/tests/plugins.js +++ b/auto_tests/tests/plugins.js @@ -3,11 +3,11 @@ * * @author konigsberg@google.com (Robert Konigsberg) */ -var pluginsTestCase = TestCase("plugins"); +describe("plugins", function() { var data; -pluginsTestCase.prototype.setUp = function() { +beforeEach(function() { document.body.innerHTML = "
"; data = "X,Y1,Y2\n" + @@ -16,12 +16,12 @@ pluginsTestCase.prototype.setUp = function() { "2,1,2\n" + "3,2,1\n" ; -}; +}); -pluginsTestCase.prototype.tearDown = function() { -}; +afterEach(function() { +}); -pluginsTestCase.prototype.testWillDrawChart = function() { +it('testWillDrawChart', function() { var draw = 0; var plugin = (function() { @@ -44,10 +44,10 @@ pluginsTestCase.prototype.testWillDrawChart = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, {plugins: [plugin]}); - assertEquals(1, draw); -}; + assert.equal(1, draw); +}); -pluginsTestCase.prototype.testPassingInstance = function() { +it('testPassingInstance', function() { // You can also pass an instance of a plugin instead of a Plugin class. var draw = 0; var p = { @@ -64,10 +64,10 @@ pluginsTestCase.prototype.testPassingInstance = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, {plugins: [p]}); - assertEquals(1, draw); -}; + assert.equal(1, draw); +}); -pluginsTestCase.prototype.testPreventDefault = function() { +it('testPreventDefault', function() { var data1 = "X,Y\n" + "20,-1\n" + "21,0\n" + @@ -121,7 +121,7 @@ pluginsTestCase.prototype.testPreventDefault = function() { p.pointClickPreventDefault = false; p.clickPreventDefault = false; clickOnPoint(); - assertEquals([ + assert.deepEqual([ ['plugin.pointClick', 20, -1], ['pointClickCallback', 20, -1], ['plugin.click', 20], @@ -132,7 +132,7 @@ pluginsTestCase.prototype.testPreventDefault = function() { p.pointClickPreventDefault = true; p.clickPreventDefault = false; clickOnPoint(); - assertEquals([ + assert.deepEqual([ ['plugin.pointClick', 20, -1] ], events); @@ -140,14 +140,14 @@ pluginsTestCase.prototype.testPreventDefault = function() { p.pointClickPreventDefault = false; p.clickPreventDefault = true; clickOnPoint(); - assertEquals([ + assert.deepEqual([ ['plugin.pointClick', 20, -1], ['pointClickCallback', 20, -1], ['plugin.click', 20] ], events); -}; +}); -pluginsTestCase.prototype.testEventSequence = function() { +it('testEventSequence', function() { var events = []; var eventLogger = function(name) { @@ -173,7 +173,7 @@ pluginsTestCase.prototype.testEventSequence = function() { var g = new Dygraph(graph, data, {plugins: [p]}); // Initial draw sequence - assertEquals([ + assert.deepEqual([ "dataDidUpdate", // should dataWillUpdate be called here, too? "predraw", "clearChart", @@ -184,7 +184,7 @@ pluginsTestCase.prototype.testEventSequence = function() { // An options change triggers a redraw, but doesn't change the data. events = []; g.updateOptions({series: {Y1: {color: 'blue'}}}); - assertEquals([ + assert.deepEqual([ "predraw", "clearChart", "willDrawChart", @@ -196,7 +196,7 @@ pluginsTestCase.prototype.testEventSequence = function() { DygraphOps.dispatchMouseDown_Point(g, 100, 100, {shiftKey: true}); DygraphOps.dispatchMouseMove_Point(g, 200, 100, {shiftKey: true}); DygraphOps.dispatchMouseUp_Point(g, 200, 100, {shiftKey: true}); - assertEquals([ + assert.deepEqual([ "clearChart", "willDrawChart", "didDrawChart" @@ -205,7 +205,7 @@ pluginsTestCase.prototype.testEventSequence = function() { // New data triggers the full sequence. events = []; g.updateOptions({file: data + '\n4,1,2'}); - assertEquals([ + assert.deepEqual([ "dataWillUpdate", "dataDidUpdate", "predraw", @@ -213,9 +213,9 @@ pluginsTestCase.prototype.testEventSequence = function() { "willDrawChart", "didDrawChart" ], events); -}; +}); -pluginsTestCase.prototype.testDestroyCalledInOrder = function() { +it('testDestroyCalledInOrder', function() { var destructions = []; var makePlugin = function(name) { return { @@ -231,7 +231,9 @@ pluginsTestCase.prototype.testDestroyCalledInOrder = function() { plugins: [makePlugin('p'), makePlugin('q')] }); - assertEquals([], destructions); + assert.deepEqual([], destructions); g.destroy(); - assertEquals(['q', 'p'], destructions); -}; + assert.deepEqual(['q', 'p'], destructions); +}); + +}); diff --git a/auto_tests/tests/plugins_legend.js b/auto_tests/tests/plugins_legend.js index 3288329..29fcb03 100644 --- a/auto_tests/tests/plugins_legend.js +++ b/auto_tests/tests/plugins_legend.js @@ -3,16 +3,16 @@ * * @author akiya.mizukoshi@gmail.com (Akiyah) */ -var pluginsLegendTestCase = TestCase("plugins-legend"); +describe("plugins-legend", function() { -pluginsLegendTestCase.prototype.setUp = function() { +beforeEach(function() { document.body.innerHTML = "
"; -}; +}); -pluginsLegendTestCase.prototype.tearDown = function() { -}; +afterEach(function() { +}); -pluginsLegendTestCase.prototype.testLegendEscape = function() { +it('testLegendEscape', function() { var opts = { width: 480, height: 320 @@ -41,6 +41,8 @@ pluginsLegendTestCase.prototype.testLegendEscape = function() { legendPlugin.select(e); var legendSpan = $(legendPlugin.legend_div_).find("span b span"); - assertEquals("<script>alert('XSS')</script>", legendSpan.html()); -}; + assert.equal("<script>alert('XSS')</script>", legendSpan.html()); +}); + +}); diff --git a/auto_tests/tests/range_selector.js b/auto_tests/tests/range_selector.js index aa7bd60..0c7c8dc 100644 --- a/auto_tests/tests/range_selector.js +++ b/auto_tests/tests/range_selector.js @@ -4,16 +4,16 @@ * @fileoverview Regression tests for range selector. * @author paul.eric.felix@gmail.com (Paul Felix) */ -var RangeSelectorTestCase = TestCase("range-selector"); +describe("range-selector", function() { -RangeSelectorTestCase.prototype.setUp = function() { +beforeEach(function() { document.body.innerHTML = "
"; -}; +}); -RangeSelectorTestCase.prototype.tearDown = function() { -}; +afterEach(function() { +}); -RangeSelectorTestCase.prototype.testRangeSelector = function() { +it('testRangeSelector', function() { var opts = { width: 480, height: 320, @@ -34,9 +34,9 @@ RangeSelectorTestCase.prototype.testRangeSelector = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); assertGraphExistence(g, graph); -}; +}); -RangeSelectorTestCase.prototype.testRangeSelectorWithErrorBars = function() { +it('testRangeSelectorWithErrorBars', function() { var opts = { width: 480, height: 320, @@ -58,9 +58,9 @@ RangeSelectorTestCase.prototype.testRangeSelectorWithErrorBars = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); assertGraphExistence(g, graph); -}; +}); -RangeSelectorTestCase.prototype.testRangeSelectorWithCustomBars = function() { +it('testRangeSelectorWithCustomBars', function() { var opts = { width: 480, height: 320, @@ -82,9 +82,9 @@ RangeSelectorTestCase.prototype.testRangeSelectorWithCustomBars = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); assertGraphExistence(g, graph); -}; +}); -RangeSelectorTestCase.prototype.testRangeSelectorWithLogScale = function() { +it('testRangeSelectorWithLogScale', function() { var opts = { width: 480, height: 320, @@ -106,9 +106,9 @@ RangeSelectorTestCase.prototype.testRangeSelectorWithLogScale = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); assertGraphExistence(g, graph); -}; +}); -RangeSelectorTestCase.prototype.testRangeSelectorOptions = function() { +it('testRangeSelectorOptions', function() { var opts = { width: 480, height: 320, @@ -132,9 +132,9 @@ RangeSelectorTestCase.prototype.testRangeSelectorOptions = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); assertGraphExistence(g, graph); -}; +}); -RangeSelectorTestCase.prototype.testAdditionalRangeSelectorOptions = function() { +it('testAdditionalRangeSelectorOptions', function() { var opts = { width: 480, height: 320, @@ -162,9 +162,9 @@ RangeSelectorTestCase.prototype.testAdditionalRangeSelectorOptions = function() var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); assertGraphExistence(g, graph); -}; +}); -RangeSelectorTestCase.prototype.testRangeSelectorEnablingAfterCreation = function() { +it('testRangeSelectorEnablingAfterCreation', function() { var opts = { width: 480, height: 320, @@ -185,10 +185,10 @@ RangeSelectorTestCase.prototype.testRangeSelectorEnablingAfterCreation = functio var g = new Dygraph(graph, data, opts); g.updateOptions({showRangeSelector: true}); assertGraphExistence(g, graph); -}; +}); // The animatedZooms option does not work with the range selector. Make sure it gets turned off. -RangeSelectorTestCase.prototype.testRangeSelectorWithAnimatedZoomsOption = function() { +it('testRangeSelectorWithAnimatedZoomsOption', function() { var opts = { width: 480, height: 320, @@ -210,10 +210,10 @@ RangeSelectorTestCase.prototype.testRangeSelectorWithAnimatedZoomsOption = funct var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); assertGraphExistence(g, graph); - assertFalse(g.getOption('animatedZooms')); -}; + assert.isFalse(g.getOption('animatedZooms')); +}); -RangeSelectorTestCase.prototype.testRangeSelectorWithAnimatedZoomsOption2 = function() { +it('testRangeSelectorWithAnimatedZoomsOption2', function() { var opts = { width: 480, height: 320, @@ -235,10 +235,10 @@ RangeSelectorTestCase.prototype.testRangeSelectorWithAnimatedZoomsOption2 = func var g = new Dygraph(graph, data, opts); g.updateOptions({showRangeSelector: true}); assertGraphExistence(g, graph); - assertFalse(g.getOption('animatedZooms')); -}; + assert.isFalse(g.getOption('animatedZooms')); +}); -RangeSelectorTestCase.prototype.testRangeSelectorInteraction = function() { +it('testRangeSelectorInteraction', function() { var opts = { width: 480, height: 320, @@ -289,7 +289,7 @@ RangeSelectorTestCase.prototype.testRangeSelectorInteraction = function() { var newXRange = g.xAxisRange().slice(); assert('left zoomhandle should have moved: '+newXRange[0]+'>'+xRange[0], newXRange[0] > xRange[0]); - assertEquals('right zoomhandle should not have moved', xRange[1], newXRange[1]); + assert.equal('right zoomhandle should not have moved', xRange[1], newXRange[1]); // Move right zoomhandle in xRange = newXRange; @@ -319,7 +319,7 @@ RangeSelectorTestCase.prototype.testRangeSelectorInteraction = function() { var newXRange = g.xAxisRange().slice(); assert('right zoomhandle should have moved: '+newXRange[1]+'<'+xRange[1], newXRange[1] < xRange[1]); - assertEquals('left zoomhandle should not have moved', xRange[0], newXRange[0]); + assert.equal('left zoomhandle should not have moved', xRange[0], newXRange[0]); // Pan left xRange = newXRange; @@ -355,10 +355,10 @@ RangeSelectorTestCase.prototype.testRangeSelectorInteraction = function() { var newXRange = g.xAxisRange().slice(); assert(newXRange[0]+'<'+xRange[0], newXRange[0] < xRange[0]); assert(newXRange[1]+'<'+xRange[1], newXRange[1] < xRange[1]); -}; +}); -RangeSelectorTestCase.prototype.testRangeSelectorPositionIfXAxisNotDrawn = function() { +it('testRangeSelectorPositionIfXAxisNotDrawn', function() { var opts = { width: 480, height: 100, @@ -379,12 +379,12 @@ RangeSelectorTestCase.prototype.testRangeSelectorPositionIfXAxisNotDrawn = funct // xAxis shouldn't be reserved since it isn't drawn. assertGraphExistence(g, graph); var bgcanvas = graph.getElementsByClassName('dygraph-rangesel-bgcanvas')[0]; - assertEquals("Range selector is not at the expected position.","70px", bgcanvas.style.top); + assert.equal("Range selector is not at the expected position.","70px", bgcanvas.style.top); var fgcanvas = graph.getElementsByClassName('dygraph-rangesel-fgcanvas')[0]; - assertEquals("Range selector is not at the expected position.","70px", fgcanvas.style.top); -}; + assert.equal("Range selector is not at the expected position.","70px", fgcanvas.style.top); +}); -RangeSelectorTestCase.prototype.testMiniPlotDrawn = function() { +it('testMiniPlotDrawn', function() { // Install Proxy to track canvas calls. var origFunc = Dygraph.getContext; var miniHtx; @@ -416,14 +416,14 @@ RangeSelectorTestCase.prototype.testMiniPlotDrawn = function() { var g = new Dygraph(graph, data, opts); // TODO(danvk): more precise tests. - assertNotNull(miniHtx); - assertTrue(0 < CanvasAssertions.numLinesDrawn(miniHtx, '#ff0000')); + assert.isNotNull(miniHtx); + assert.isTrue(0 < CanvasAssertions.numLinesDrawn(miniHtx, '#ff0000')); Dygraph.getContext = origFunc; -}; +}); // Tests data computation for the mini plot with a single series. -RangeSelectorTestCase.prototype.testSingleCombinedSeries = function() { +it('testSingleCombinedSeries', function() { var opts = { showRangeSelector: true, labels: ['X', 'Y1'] @@ -437,10 +437,10 @@ RangeSelectorTestCase.prototype.testSingleCombinedSeries = function() { var g = new Dygraph(graph, data, opts); var rangeSelector = g.getPluginInstance_(Dygraph.Plugins.RangeSelector); - assertNotNull(rangeSelector); + assert.isNotNull(rangeSelector); var combinedSeries = rangeSelector.computeCombinedSeriesAndLimits_(); - assertEquals({ + assert.deepEqual({ yMin: 1 - 7 * 0.25, // 25% padding yMax: 8 + 7 * 0.25, data: [ @@ -449,11 +449,11 @@ RangeSelectorTestCase.prototype.testSingleCombinedSeries = function() { [10, 8] ] }, combinedSeries); -}; +}); // Tests that multiple series are averaged for the miniplot. -RangeSelectorTestCase.prototype.testCombinedSeries = function() { +it('testCombinedSeries', function() { var opts = { showRangeSelector: true, labels: ['X', 'Y1', 'Y2'] @@ -467,10 +467,10 @@ RangeSelectorTestCase.prototype.testCombinedSeries = function() { var g = new Dygraph(graph, data, opts); var rangeSelector = g.getPluginInstance_(Dygraph.Plugins.RangeSelector); - assertNotNull(rangeSelector); + assert.isNotNull(rangeSelector); var combinedSeries = rangeSelector.computeCombinedSeriesAndLimits_(); - assertEquals({ + assert.deepEqual({ yMin: 2 - 6 * 0.25, // 25% padding on combined series range. yMax: 8 + 6 * 0.25, data: [ @@ -479,10 +479,10 @@ RangeSelectorTestCase.prototype.testCombinedSeries = function() { [10, 8] ] }, combinedSeries); -}; +}); // Tests selection of a specific series to average for the mini plot. -RangeSelectorTestCase.prototype.testSelectedCombinedSeries = function() { +it('testSelectedCombinedSeries', function() { var opts = { showRangeSelector: true, labels: ['X', 'Y1', 'Y2', 'Y3', 'Y4'], @@ -500,10 +500,10 @@ RangeSelectorTestCase.prototype.testSelectedCombinedSeries = function() { var g = new Dygraph(graph, data, opts); var rangeSelector = g.getPluginInstance_(Dygraph.Plugins.RangeSelector); - assertNotNull(rangeSelector); + assert.isNotNull(rangeSelector); var combinedSeries = rangeSelector.computeCombinedSeriesAndLimits_(); - assertEquals({ + assert.deepEqual({ yMin: 4 - 5 * 0.25, // 25% padding on combined series range. yMax: 9 + 5 * 0.25, data: [ @@ -512,10 +512,10 @@ RangeSelectorTestCase.prototype.testSelectedCombinedSeries = function() { [10, 5] ] }, combinedSeries); -}; +}); // Tests data computation for the mini plot with a single error bar series. -RangeSelectorTestCase.prototype.testSingleCombinedSeriesCustomBars = function() { +it('testSingleCombinedSeriesCustomBars', function() { var opts = { customBars: true, showRangeSelector: true, @@ -530,10 +530,10 @@ RangeSelectorTestCase.prototype.testSingleCombinedSeriesCustomBars = function() var g = new Dygraph(graph, data, opts); var rangeSelector = g.getPluginInstance_(Dygraph.Plugins.RangeSelector); - assertNotNull(rangeSelector); + assert.isNotNull(rangeSelector); var combinedSeries = rangeSelector.computeCombinedSeriesAndLimits_(); - assertEquals({ + assert.deepEqual({ yMin: 1 - 7 * 0.25, // 25% padding yMax: 8 + 7 * 0.25, data: [ @@ -542,9 +542,9 @@ RangeSelectorTestCase.prototype.testSingleCombinedSeriesCustomBars = function() [10, 8] ] }, combinedSeries); -}; +}); -RangeSelectorTestCase.prototype.testSingleCombinedSeriesErrorBars = function() { +it('testSingleCombinedSeriesErrorBars', function() { var opts = { errorBars: true, showRangeSelector: true, @@ -559,10 +559,10 @@ RangeSelectorTestCase.prototype.testSingleCombinedSeriesErrorBars = function() { var g = new Dygraph(graph, data, opts); var rangeSelector = g.getPluginInstance_(Dygraph.Plugins.RangeSelector); - assertNotNull(rangeSelector); + assert.isNotNull(rangeSelector); var combinedSeries = rangeSelector.computeCombinedSeriesAndLimits_(); - assertEquals({ + assert.deepEqual({ yMin: 1 - 7 * 0.25, // 25% padding yMax: 8 + 7 * 0.25, data: [ @@ -571,10 +571,10 @@ RangeSelectorTestCase.prototype.testSingleCombinedSeriesErrorBars = function() { [10, 8] ] }, combinedSeries); -}; +}); // Tests data computation for the mini plot with two custom bar series. -RangeSelectorTestCase.prototype.testTwoCombinedSeriesCustomBars = function() { +it('testTwoCombinedSeriesCustomBars', function() { var opts = { customBars: true, showRangeSelector: true, @@ -589,10 +589,10 @@ RangeSelectorTestCase.prototype.testTwoCombinedSeriesCustomBars = function() { var g = new Dygraph(graph, data, opts); var rangeSelector = g.getPluginInstance_(Dygraph.Plugins.RangeSelector); - assertNotNull(rangeSelector); + assert.isNotNull(rangeSelector); var combinedSeries = rangeSelector.computeCombinedSeriesAndLimits_(); - assertEquals({ + assert.deepEqual({ yMin: 3 - 7 * 0.25, // 25% padding yMax: 10 + 7 * 0.25, data: [ @@ -601,15 +601,17 @@ RangeSelectorTestCase.prototype.testTwoCombinedSeriesCustomBars = function() { [10, 10] ] }, combinedSeries); -}; +}); var assertGraphExistence = function(g, graph) { - assertNotNull(g); + assert.isNotNull(g); var zoomhandles = graph.getElementsByClassName('dygraph-rangesel-zoomhandle'); - assertEquals(2, zoomhandles.length); + assert.equal(2, zoomhandles.length); var bgcanvas = graph.getElementsByClassName('dygraph-rangesel-bgcanvas'); - assertEquals(1, bgcanvas.length); + assert.equal(1, bgcanvas.length); var fgcanvas = graph.getElementsByClassName('dygraph-rangesel-fgcanvas'); - assertEquals(1, fgcanvas.length); + assert.equal(1, fgcanvas.length); }; + +}); diff --git a/auto_tests/tests/range_tests.js b/auto_tests/tests/range_tests.js index 1612f41..bdb87de 100644 --- a/auto_tests/tests/range_tests.js +++ b/auto_tests/tests/range_tests.js @@ -25,7 +25,7 @@ * @author konigsberg@google.com (Robert Konigsberg) */ var ZERO_TO_FIFTY = [[ 10, 0 ] , [ 20, 50 ]]; -var ZERO_TO_FIFTY_STEPS = function() { +var ZERO_TO_FIFTY_STEPS = (function() { var a = []; var x = 10; var y = 0; @@ -34,16 +34,17 @@ var ZERO_TO_FIFTY_STEPS = function() { a.push([x + (step * .2), y + step]); } return a; -} (); +}()); + var FIVE_TO_ONE_THOUSAND = [ [ 1, 10 ], [ 2, 20 ], [ 3, 30 ], [ 4, 40 ] , [ 5, 50 ], [ 6, 60 ], [ 7, 70 ], [ 8, 80 ], [ 9, 90 ] , [ 10, 1000 ]]; -var RangeTestCase = TestCase("range-tests"); +describe("range-tests", function() { -RangeTestCase.prototype.setUp = function() { +beforeEach(function() { document.body.innerHTML = "
"; -}; +}); var createGraph = function(opts, data, expectRangeX, expectRangeY) { if (data === undefined) data = ZERO_TO_FIFTY_STEPS; @@ -52,8 +53,8 @@ var createGraph = function(opts, data, expectRangeX, expectRangeY) { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - assertEqualsDelta(expectRangeX, g.xAxisRange(), 0.01); - assertEqualsDelta(expectRangeY, g.yAxisRange(0), 0.01); + assert.equalsDelta(expectRangeX, g.xAxisRange(), 0.01); + assert.equalsDelta(expectRangeY, g.yAxisRange(0), 0.01); return g; }; @@ -62,53 +63,53 @@ var createGraph = function(opts, data, expectRangeX, expectRangeY) { * Test that changes to valueRange and dateWindow are reflected * appropriately. */ -RangeTestCase.prototype.testRangeSetOperations = function() { +it('testRangeSetOperations', function() { var g = createGraph({valueRange : [ 0, 55 ]}); g.updateOptions({ dateWindow : [ 12, 18 ] }); - assertEquals([12, 18], g.xAxisRange()); - assertEquals([0, 55], g.yAxisRange(0)); + assert.deepEqual([12, 18], g.xAxisRange()); + assert.deepEqual([0, 55], g.yAxisRange(0)); g.updateOptions({ valueRange : [ 10, 40 ] }); - assertEquals([12, 18], g.xAxisRange()); - assertEquals([10, 40], g.yAxisRange(0)); + assert.deepEqual([12, 18], g.xAxisRange()); + assert.deepEqual([10, 40], g.yAxisRange(0)); g.updateOptions({ valueRange: [10, NaN] }); - assertEquals([12, 18], g.xAxisRange()); - assertEquals([10, 44.2], g.yAxisRange(0)); + assert.deepEqual([12, 18], g.xAxisRange()); + assert.deepEqual([10, 44.2], g.yAxisRange(0)); g.updateOptions({ valueRange: [10, 40] }); - assertEquals([12, 18], g.xAxisRange()); - assertEquals([10, 40], g.yAxisRange(0)); + assert.deepEqual([12, 18], g.xAxisRange()); + assert.deepEqual([10, 40], g.yAxisRange(0)); g.updateOptions({ valueRange: [10, null] }); - assertEquals([12, 18], g.xAxisRange()); - assertEquals([10, 44.2], g.yAxisRange(0)); + assert.deepEqual([12, 18], g.xAxisRange()); + assert.deepEqual([10, 44.2], g.yAxisRange(0)); g.updateOptions({ valueRange: [10, 40] }); - assertEquals([12, 18], g.xAxisRange()); - assertEquals([10, 40], g.yAxisRange(0)); + assert.deepEqual([12, 18], g.xAxisRange()); + assert.deepEqual([10, 40], g.yAxisRange(0)); g.updateOptions({ valueRange: [10, undefined] }); - assertEquals([12, 18], g.xAxisRange()); - assertEquals([10, 44.2], g.yAxisRange(0)); + assert.deepEqual([12, 18], g.xAxisRange()); + assert.deepEqual([10, 44.2], g.yAxisRange(0)); g.updateOptions({ valueRange: [10, 40] }); - assertEquals([12, 18], g.xAxisRange()); - assertEquals([10, 40], g.yAxisRange(0)); + assert.deepEqual([12, 18], g.xAxisRange()); + assert.deepEqual([10, 40], g.yAxisRange(0)); g.updateOptions({ }); - assertEquals([12, 18], g.xAxisRange()); - assertEquals([10, 40], g.yAxisRange(0)); + assert.deepEqual([12, 18], g.xAxisRange()); + assert.deepEqual([10, 40], g.yAxisRange(0)); g.updateOptions({valueRange : null, axes: {y:{valueRange : [15, 20]}}}); - assertEquals([12, 18], g.xAxisRange()); - assertEquals([15, 20], g.yAxisRange(0)); + assert.deepEqual([12, 18], g.xAxisRange()); + assert.deepEqual([15, 20], g.yAxisRange(0)); g.updateOptions({ dateWindow : null, valueRange : null, axes: null }); - assertEquals([10, 20], g.xAxisRange()); - assertEquals([0, 55], g.yAxisRange(0)); -}; + assert.deepEqual([10, 20], g.xAxisRange()); + assert.deepEqual([0, 55], g.yAxisRange(0)); +}); /** * Verify that when zoomed in by mouse operations, an empty call to @@ -122,16 +123,16 @@ var zoom = function(g, xRange, yRange) { DygraphOps.dispatchMouseMove(g, xRange[1], yRange[0]); // this is really necessary. DygraphOps.dispatchMouseUp(g, xRange[1], yRange[0]); - assertEqualsDelta(xRange, g.xAxisRange(), 0.2); - // assertEqualsDelta(originalYRange, g.yAxisRange(0), 0.2); // Not true, it's something in the middle. + assert.equalsDelta(xRange, g.xAxisRange(), 0.2); + // assert.equalsDelta(originalYRange, g.yAxisRange(0), 0.2); // Not true, it's something in the middle. var midX = (xRange[1] - xRange[0]) / 2; DygraphOps.dispatchMouseDown(g, midX, yRange[0]); DygraphOps.dispatchMouseMove(g, midX, yRange[1]); // this is really necessary. DygraphOps.dispatchMouseUp(g, midX, yRange[1]); - assertEqualsDelta(xRange, g.xAxisRange(), 0.2); - assertEqualsDelta(yRange, g.yAxisRange(0), 0.2); + assert.equalsDelta(xRange, g.xAxisRange(), 0.2); + assert.equalsDelta(yRange, g.yAxisRange(0), 0.2); } @@ -139,61 +140,61 @@ var zoom = function(g, xRange, yRange) { * Verify that when zoomed in by mouse operations, an empty call to * updateOptions doesn't change the displayed ranges. */ -RangeTestCase.prototype.testEmptyUpdateOptions_doesntUnzoom = function() { +it('testEmptyUpdateOptions_doesntUnzoom', function() { var g = createGraph(); zoom(g, [ 11, 18 ], [ 35, 40 ]); - assertEqualsDelta([11, 18], g.xAxisRange(), 0.1); - assertEqualsDelta([35, 40], g.yAxisRange(0), 0.2); + assert.equalsDelta([11, 18], g.xAxisRange(), 0.1); + assert.equalsDelta([35, 40], g.yAxisRange(0), 0.2); g.updateOptions({}); - assertEqualsDelta([11, 18], g.xAxisRange(), 0.1); - assertEqualsDelta([35, 40], g.yAxisRange(0), 0.2); -} + assert.equalsDelta([11, 18], g.xAxisRange(), 0.1); + assert.equalsDelta([35, 40], g.yAxisRange(0), 0.2); +}); /** * Verify that when zoomed in by mouse operations, a call to * updateOptions({ dateWindow : null, valueRange : null }) fully * unzooms. */ -RangeTestCase.prototype.testRestoreOriginalRanges_viaUpdateOptions = function() { +it('testRestoreOriginalRanges_viaUpdateOptions', function() { var g = createGraph(); zoom(g, [ 11, 18 ], [ 35, 40 ]); g.updateOptions({ dateWindow : null, valueRange : null }); - assertEquals([0, 55], g.yAxisRange(0)); - assertEquals([10, 20], g.xAxisRange()); -} + assert.deepEqual([0, 55], g.yAxisRange(0)); + assert.deepEqual([10, 20], g.xAxisRange()); +}); /** * Verify that log scale axis range is properly specified. */ -RangeTestCase.prototype.testLogScaleExcludesZero = function() { +it('testLogScaleExcludesZero', function() { var g = new Dygraph("graph", FIVE_TO_ONE_THOUSAND, { logscale : true }); - assertEquals([10, 1099], g.yAxisRange(0)); + assert.deepEqual([10, 1099], g.yAxisRange(0)); g.updateOptions({ logscale : false }); - assertEquals([0, 1099], g.yAxisRange(0)); -} + assert.deepEqual([0, 1099], g.yAxisRange(0)); +}); /** * Verify that includeZero range is properly specified. */ -RangeTestCase.prototype.testIncludeZeroIncludesZero = function() { +it('testIncludeZeroIncludesZero', function() { var g = new Dygraph("graph", [[0, 500], [500, 1000]], { includeZero : true }); - assertEquals([0, 1100], g.yAxisRange(0)); + assert.deepEqual([0, 1100], g.yAxisRange(0)); g.updateOptions({ includeZero : false }); - assertEquals([450, 1050], g.yAxisRange(0)); -} + assert.deepEqual([450, 1050], g.yAxisRange(0)); +}); /** * Verify that includeZero range is properly specified per axis. */ -RangeTestCase.prototype.testIncludeZeroPerAxis = function() { +it('testIncludeZeroPerAxis', function() { var g = new Dygraph("graph", 'X,A,B\n'+ '0,50,50\n'+ @@ -216,8 +217,8 @@ RangeTestCase.prototype.testIncludeZeroPerAxis = function() { }); - assertEquals([44, 116], g.yAxisRange(0)); - assertEquals([0, 121], g.yAxisRange(1)); + assert.deepEqual([44, 116], g.yAxisRange(0)); + assert.deepEqual([0, 121], g.yAxisRange(1)); g.updateOptions({ axes: { @@ -225,76 +226,76 @@ RangeTestCase.prototype.testIncludeZeroPerAxis = function() { } }); - assertEquals([44, 116], g.yAxisRange(1)); -} + assert.deepEqual([44, 116], g.yAxisRange(1)); +}); /** * Verify that very large Y ranges don't break things. */ -RangeTestCase.prototype.testHugeRange = function() { +it('testHugeRange', function() { var g = new Dygraph("graph", [[0, -1e120], [1, 1e230]], { includeZero : true }); - assertEqualsDelta(1, -1e229 / g.yAxisRange(0)[0], 0.001); - assertEqualsDelta(1, 1.1e230 / g.yAxisRange(0)[1], 0.001); -} + assert.equalsDelta(1, -1e229 / g.yAxisRange(0)[0], 0.001); + assert.equalsDelta(1, 1.1e230 / g.yAxisRange(0)[1], 0.001); +}); /** * Verify old-style avoidMinZero option. */ -RangeTestCase.prototype.testAvoidMinZero = function() { +it('testAvoidMinZero', function() { var g = createGraph({ avoidMinZero: true, }, ZERO_TO_FIFTY_STEPS, [10, 20], [-5, 55]); -}; +}); /** * Verify ranges with user-specified padding, implicit avoidMinZero. */ -RangeTestCase.prototype.testPaddingAuto = function() { +it('testPaddingAuto', function() { var g = createGraph({ xRangePad: 42, yRangePad: 30 }, ZERO_TO_FIFTY_STEPS, [9, 21], [-5, 55]); -}; +}); /** * Verify auto range with drawAxesAtZero. */ -RangeTestCase.prototype.testPaddingAutoAxisAtZero = function() { +it('testPaddingAutoAxisAtZero', function() { var g = createGraph({ drawAxesAtZero: true, }, ZERO_TO_FIFTY_STEPS, [10, 20], [0, 55]); -}; +}); /** * Verify user-specified range with padding and drawAxesAtZero options. * Try explicit range matching the auto range, should have identical results. */ -RangeTestCase.prototype.testPaddingRange1 = function() { +it('testPaddingRange1', function() { var g = createGraph({ valueRange: [0, 50], xRangePad: 42, yRangePad: 30, drawAxesAtZero: true }, ZERO_TO_FIFTY_STEPS, [9, 21], [-5, 55]); -}; +}); /** * Verify user-specified range with padding and drawAxesAtZero options. * User-supplied range differs from the auto range. */ -RangeTestCase.prototype.testPaddingRange2 = function() { +it('testPaddingRange2', function() { var g = createGraph({ valueRange: [10, 60], xRangePad: 42, yRangePad: 30, drawAxesAtZero: true, }, ZERO_TO_FIFTY_STEPS, [9, 21], [5, 65]); -}; +}); /** * Verify drawAxesAtZero and includeZero. */ -RangeTestCase.prototype.testPaddingYAtZero = function() { +it('testPaddingYAtZero', function() { var g = createGraph({ includeZero: true, xRangePad: 42, @@ -305,36 +306,36 @@ RangeTestCase.prototype.testPaddingYAtZero = function() { [10, 20], [30, 50] ], [-14, 34], [-5, 55]); -}; +}); /** * Verify logscale, compat mode. */ -RangeTestCase.prototype.testLogscaleCompat = function() { +it('testLogscaleCompat', function() { var g = createGraph({ logscale: true }, [[-10, 10], [10, 10], [30, 1000]], [-10, 30], [10, 1099]); -}; +}); /** * Verify logscale, new mode. */ -RangeTestCase.prototype.testLogscalePad = function() { +it('testLogscalePad', function() { var g = createGraph({ logscale: true, yRangePad: 30 }, [[-10, 10], [10, 10], [30, 1000]], [-10, 30], [5.01691, 1993.25801]); -}; +}); /** * Verify scrolling all-zero region, traditional. */ -RangeTestCase.prototype.testZeroScroll = function() { - g = new Dygraph( +it('testZeroScroll', function() { + var g = new Dygraph( document.getElementById("graph"), "X,Y\n" + "1,0\n" + @@ -345,13 +346,13 @@ RangeTestCase.prototype.testZeroScroll = function() { animatedZooms: true, avoidMinZero: true }); -}; +}); /** * Verify scrolling all-zero region, new-style. */ -RangeTestCase.prototype.testZeroScroll2 = function() { - g = new Dygraph( +it('testZeroScroll2', function() { + var g = new Dygraph( document.getElementById("graph"), "X,Y\n" + "1,0\n" + @@ -363,4 +364,6 @@ RangeTestCase.prototype.testZeroScroll2 = function() { xRangePad: 4, yRangePad: 4 }); -}; +}); + +}); diff --git a/auto_tests/tests/resize.js b/auto_tests/tests/resize.js index 5a996d2..8f13806 100644 --- a/auto_tests/tests/resize.js +++ b/auto_tests/tests/resize.js @@ -3,7 +3,7 @@ * * @author konigsberg@google.com (Robert Konigsberg) */ -var ResizeTestCase = TestCase("resize"); +describe("resize", function() { var data = "X,Y\n" + @@ -14,14 +14,14 @@ var data = "5,300\n" + "6,100\n"; -ResizeTestCase.prototype.setUp = function() { +beforeEach(function() { document.body.innerHTML = "
"; -}; +}); -ResizeTestCase.prototype.tearDown = function() { -}; +afterEach(function() { +}); -ResizeTestCase.prototype.testResizeMaintainsMouseOperations = function() { +it('testResizeMaintainsMouseOperations', function() { document.body.innerHTML = '
' + ''; @@ -41,24 +41,24 @@ ResizeTestCase.prototype.testResizeMaintainsMouseOperations = function() { DygraphOps.dispatchMouseUp_Point(g, x2 - 1, y); } - g = new Dygraph(graph, data, {highlightCallback: callback}); + var g = new Dygraph(graph, data, {highlightCallback: callback}); strum(g, 300, 640); - assertEquals(6, callbackCount); + assert.equal(6, callbackCount); document.getElementById("graph").style.width = "500px"; g.resize(); callbackCount = 0; strum(g, 300, 500); - assertEquals(6, callbackCount); -}; + assert.equal(6, callbackCount); +}); /** * Tests that a graph created in a not-displayed div works as expected * if the graph options include height and width. Resize not needed. */ -ResizeTestCase.prototype.testHiddenDivWithSizedGraph = function() { +it('testHiddenDivWithSizedGraph', function() { var div = document.getElementById("graph"); div.style.display = 'none'; @@ -66,9 +66,9 @@ ResizeTestCase.prototype.testHiddenDivWithSizedGraph = function() { div.style.display = ''; var area = g.getArea(); - assertTrue(area.w > 0); - assertTrue(area.h > 0); -}; + assert.isTrue(area.w > 0); + assert.isTrue(area.h > 0); +}); /** * Tests that a graph created in a not-displayed div with @@ -76,7 +76,7 @@ ResizeTestCase.prototype.testHiddenDivWithSizedGraph = function() { * expected. The user needs to call resize() on it after displaying * it. */ -ResizeTestCase.prototype.testHiddenDivWithResize = function() { +it('testHiddenDivWithResize', function() { var div = document.getElementById("graph"); div.style.display = 'none'; @@ -89,14 +89,16 @@ ResizeTestCase.prototype.testHiddenDivWithResize = function() { div.style.display = ''; g.resize(); - area = g.getArea(); - assertTrue(area.w > 0); - assertTrue(area.h > 0); + var area = g.getArea(); + assert.isTrue(area.w > 0); + assert.isTrue(area.h > 0); // Regression test: check that graph remains visible after no-op resize. g.resize(); var x = Math.floor(g.toDomXCoord(2)); var y = Math.floor(g.toDomYCoord(200)); - assertEquals("Unexpected grid color found at pixel: x: " + x + " y: " + y, + assert.equal("Unexpected grid color found at pixel: x: " + x + " y: " + y, [0, 128, 128, 255], Util.samplePixel(g.hidden_, x, y)); -}; +}); + +}); diff --git a/auto_tests/tests/rolling_average.js b/auto_tests/tests/rolling_average.js index 696a49a..41a6521 100644 --- a/auto_tests/tests/rolling_average.js +++ b/auto_tests/tests/rolling_average.js @@ -3,16 +3,16 @@ * * @author danvk@google.com (Dan Vanderkam) */ -var rollingAverageTestCase = TestCase("rolling-average"); +describe("rolling-average", function() { -rollingAverageTestCase.prototype.setUp = function() { +beforeEach(function() { document.body.innerHTML = "
"; -}; +}); -rollingAverageTestCase.prototype.tearDown = function() { -}; +afterEach(function() { +}); -rollingAverageTestCase.prototype.testRollingAverage = function() { +it('testRollingAverage', function() { var opts = { width: 480, height: 320, @@ -29,35 +29,35 @@ rollingAverageTestCase.prototype.testRollingAverage = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - g.setSelection(0); assertEquals("0: Y: 0", Util.getLegend()); - g.setSelection(1); assertEquals("1: Y: 1", Util.getLegend()); - g.setSelection(2); assertEquals("2: Y: 2", Util.getLegend()); - g.setSelection(3); assertEquals("3: Y: 3", Util.getLegend()); - assertEquals(1, g.rollPeriod()); + g.setSelection(0); assert.equal("0: Y: 0", Util.getLegend()); + g.setSelection(1); assert.equal("1: Y: 1", Util.getLegend()); + g.setSelection(2); assert.equal("2: Y: 2", Util.getLegend()); + g.setSelection(3); assert.equal("3: Y: 3", Util.getLegend()); + assert.equal(1, g.rollPeriod()); g.updateOptions({rollPeriod: 2}); - g.setSelection(0); assertEquals("0: Y: 0", Util.getLegend()); - g.setSelection(1); assertEquals("1: Y: 0.5", Util.getLegend()); - g.setSelection(2); assertEquals("2: Y: 1.5", Util.getLegend()); - g.setSelection(3); assertEquals("3: Y: 2.5", Util.getLegend()); - assertEquals(2, g.rollPeriod()); + g.setSelection(0); assert.equal("0: Y: 0", Util.getLegend()); + g.setSelection(1); assert.equal("1: Y: 0.5", Util.getLegend()); + g.setSelection(2); assert.equal("2: Y: 1.5", Util.getLegend()); + g.setSelection(3); assert.equal("3: Y: 2.5", Util.getLegend()); + assert.equal(2, g.rollPeriod()); g.updateOptions({rollPeriod: 3}); - g.setSelection(0); assertEquals("0: Y: 0", Util.getLegend()); - g.setSelection(1); assertEquals("1: Y: 0.5", Util.getLegend()); - g.setSelection(2); assertEquals("2: Y: 1", Util.getLegend()); - g.setSelection(3); assertEquals("3: Y: 2", Util.getLegend()); - assertEquals(3, g.rollPeriod()); + g.setSelection(0); assert.equal("0: Y: 0", Util.getLegend()); + g.setSelection(1); assert.equal("1: Y: 0.5", Util.getLegend()); + g.setSelection(2); assert.equal("2: Y: 1", Util.getLegend()); + g.setSelection(3); assert.equal("3: Y: 2", Util.getLegend()); + assert.equal(3, g.rollPeriod()); g.updateOptions({rollPeriod: 4}); - g.setSelection(0); assertEquals("0: Y: 0", Util.getLegend()); - g.setSelection(1); assertEquals("1: Y: 0.5", Util.getLegend()); - g.setSelection(2); assertEquals("2: Y: 1", Util.getLegend()); - g.setSelection(3); assertEquals("3: Y: 1.5", Util.getLegend()); - assertEquals(4, g.rollPeriod()); -}; - -rollingAverageTestCase.prototype.testRollBoxDoesntDisapper = function() { + g.setSelection(0); assert.equal("0: Y: 0", Util.getLegend()); + g.setSelection(1); assert.equal("1: Y: 0.5", Util.getLegend()); + g.setSelection(2); assert.equal("2: Y: 1", Util.getLegend()); + g.setSelection(3); assert.equal("3: Y: 1.5", Util.getLegend()); + assert.equal(4, g.rollPeriod()); +}); + +it('testRollBoxDoesntDisapper', function() { var opts = { showRoller: true }; @@ -72,17 +72,17 @@ rollingAverageTestCase.prototype.testRollBoxDoesntDisapper = function() { var g = new Dygraph(graph, data, opts); var roll_box = graph.getElementsByTagName("input"); - assertEquals(1, roll_box.length); - assertEquals("1", roll_box[0].value); + assert.equal(1, roll_box.length); + assert.equal("1", roll_box[0].value); graph.style.width = "500px"; g.resize(); - assertEquals(1, roll_box.length); - assertEquals("1", roll_box[0].value); -}; + assert.equal(1, roll_box.length); + assert.equal("1", roll_box[0].value); +}); // Regression test for http://code.google.com/p/dygraphs/issues/detail?id=426 -rollingAverageTestCase.prototype.testRollShortFractions = function() { +it('testRollShortFractions', function() { var opts = { customBars: true, labels: ['x', 'A'] @@ -98,10 +98,10 @@ rollingAverageTestCase.prototype.testRollShortFractions = function() { var rolled1 = g.dataHandler_.rollingAverage(data1, 1, g); var rolled2 = g.dataHandler_.rollingAverage(data2, 1, g); - assertEquals(rolled1[0], rolled2[0]); -}; + assert.equal(rolled1[0], rolled2[0]); +}); -rollingAverageTestCase.prototype.testRollCustomBars = function() { +it('testRollCustomBars', function() { var opts = { customBars: true, rollPeriod: 2, @@ -116,13 +116,13 @@ rollingAverageTestCase.prototype.testRollCustomBars = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); var rolled = getRolledData(g, data, 1, 2); - assertEquals([1, 10, [1, 20]], rolled[0]); - assertEquals([2, 15, [1, 25]], rolled[1]); - assertEquals([3, 25, [1, 35]], rolled[2]); - assertEquals([4, 35, [1, 45]], rolled[3]); -}; + assert.deepEqual([1, 10, [1, 20]], rolled[0]); + assert.deepEqual([2, 15, [1, 25]], rolled[1]); + assert.deepEqual([3, 25, [1, 35]], rolled[2]); + assert.deepEqual([4, 35, [1, 45]], rolled[3]); +}); -rollingAverageTestCase.prototype.testRollErrorBars = function() { +it('testRollErrorBars', function() { var opts = { errorBars: true, rollPeriod: 2, @@ -137,19 +137,19 @@ rollingAverageTestCase.prototype.testRollErrorBars = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); var rolled = getRolledData(g, data, 1, 2); - assertEquals([1, 10, [8, 12]], rolled[0]); + assert.deepEqual([1, 10, [8, 12]], rolled[0]); // variance = sqrt( pow(error) * rollPeriod) var variance = Math.sqrt(2); for (var i=1;i