X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=auto_tests%2Ftests%2Fpathological_cases.js;fp=auto_tests%2Ftests%2Fpathological_cases.js;h=40e877f01bfa4c5c949a1977cf2bc2a92a2558dd;hb=5db9ad5da775ff73aa8d859c334935d01f01b930;hp=ade714c8a888243dcadb48c24db565925a10c0ae;hpb=79ea4032d8200129384974c9f14ff35cd3443b3f;p=dygraphs.git diff --git a/auto_tests/tests/pathological_cases.js b/auto_tests/tests/pathological_cases.js index ade714c..40e877f 100644 --- a/auto_tests/tests/pathological_cases.js +++ b/auto_tests/tests/pathological_cases.js @@ -160,4 +160,18 @@ it('testConstantSeriesNegativeIncludeZero', function() { assert.deepEqual([-1.1, 0], g.yAxisRange()); }); +it('should throw with non-existent divs', function() { + var data = "X,Y\n" + + "1,-1\n" + + "2,1\n"; + + assert.throws(function() { + new Dygraph(null, data); + }, /non-existent div/); + + assert.throws(function() { + new Dygraph('non-existent-div-id', data); + }, /non-existent div/); +}); + });