From 5f01c8b675331ecea9b54723e57806da07f7191a Mon Sep 17 00:00:00 2001
From: Dan Vanderkam <danvdk@gmail.com>
Date: Sun, 29 Mar 2015 19:13:23 -0400
Subject: [PATCH] Test for dashed legend

---
 auto_tests/tests/plugins_legend.js | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

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)');
+});
 
 });
-- 
2.7.4