X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;ds=sidebyside;f=auto_tests%2Ftests%2Fplugins_legend.js;h=124d929bcc38fa5ff8012f76cbdcdc9e5cc10e41;hb=a02a53659ac6e1a81fd1cad0c404104a17cd653b;hp=7fd673f64005a69d8393d6e6490cdb174c363a0e;hpb=457deb39f97d91a101e63cd54108716ea9e1c13a;p=dygraphs.git diff --git a/auto_tests/tests/plugins_legend.js b/auto_tests/tests/plugins_legend.js index 7fd673f..124d929 100644 --- a/auto_tests/tests/plugins_legend.js +++ b/auto_tests/tests/plugins_legend.js @@ -56,5 +56,19 @@ it('should let labelsDiv be an Element', function() { assert.equal('1: Y: 2', Util.nbspToSpace(labelsDiv.textContent)); }); +it('should render dashed patterns', function() { + var g = new Dygraph('graph', 'X,Y\n1,2\n', { + strokePattern: [5, 5], + color: 'red', + legend: 'always' + }); + + // The legend has a dashed line and a label. + var legendEl = document.querySelector('.dygraph-legend > span'); + assert.equal(' Y', legendEl.textContent); + var dashEl = document.querySelector('.dygraph-legend > span > div'); + assert.equal(window.getComputedStyle(dashEl)['border-bottom-color'], + 'rgb(255, 0, 0)'); +}); });