X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=auto_tests%2Ftests%2Fdata_api.js;h=631990980493ad02ccb031f359c57e6b6ebbb9f3;hb=refs%2Ftags%2Fv2.0.0;hp=e692fc61e104600067983a0a231b97c70e8ea1eb;hpb=ce31caf22475e3e1fd6d9fea192d61ff4fcd7fac;p=dygraphs.git diff --git a/auto_tests/tests/data_api.js b/auto_tests/tests/data_api.js index e692fc6..6319909 100644 --- a/auto_tests/tests/data_api.js +++ b/auto_tests/tests/data_api.js @@ -4,6 +4,7 @@ * @author danvdk@gmail.com (Dan Vanderkam) */ import Dygraph from '../../src/dygraph'; +import * as utils from '../../src/dygraph-utils'; describe("data-api", function() { cleanupAfterEach(); @@ -99,4 +100,21 @@ it('testGetRowForXDuplicates', function() { assert.equal(5, g.getRowForX(9)); }); +// indexFromSeriesName should return a value even if the series is invisible +// In 1.1.1, if you request the last set and it's invisible, the method returns undefined. +it('testIndexFromSetNameOnInvisibleSet', function() { + + var localOpts = utils.clone(opts); + localOpts.visibility = [true, false]; + + var g = new Dygraph(graphDiv, [ + "x,y1,y2", + "1,1,1", + "2,2,2", + "3,3,3" + ].join('\n'), localOpts); + + assert.equal(2, g.indexFromSetName("y2")); +}); + });