X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=auto_tests%2Ftests%2Faxis_labels.js;h=7510a52c9b073a1542e4ad13453daebccd4dcbb1;hb=72223c02efb7e8629bebb20e1be5ce5e880e70b7;hp=6fc54e50891b82396c2b090a283a496a4b4cdfe2;hpb=795b16307db2a673ba7aa3452f6f6b0e93baeb3a;p=dygraphs.git diff --git a/auto_tests/tests/axis_labels.js b/auto_tests/tests/axis_labels.js index 6fc54e5..7510a52 100644 --- a/auto_tests/tests/axis_labels.js +++ b/auto_tests/tests/axis_labels.js @@ -84,6 +84,7 @@ AxisLabelsTestCase.prototype.testMinusOneToOne = function() { AxisLabelsTestCase.prototype.testSmallRangeNearZero = function() { var opts = { + drawAxesAtZero: true, width: 480, height: 320 }; @@ -420,3 +421,30 @@ AxisLabelsTestCase.prototype.testGlobalFormatters = function() { g.setSelection(9); assertEquals("vf9: y:vf18", getLegend()); }; + +AxisLabelsTestCase.prototype.testSeriesOrder = function() { + var opts = { + width: 480, + height: 320 + }; + var data = "x,00,01,10,11\n" + + "0,101,201,301,401\n" + + "1,102,202,302,402\n" + + "2,103,203,303,403\n" + + "3,104,204,304,404\n" + ; + + var graph = document.getElementById("graph"); + var g = new Dygraph(graph, data, opts); + + g.setSelection(2); + assertEquals('2: 00:103 01:203 10:303 11:403', getLegend()); + + // Sanity checks for indexFromSetName + assertEquals(0, g.indexFromSetName("x")); + assertEquals(1, g.indexFromSetName("00")); + assertEquals(null, g.indexFromSetName("abcde")); + + // Verify that we get the label list back in the right order + assertEquals(["x", "00", "01", "10", "11"], g.getLabels()); +};