Skip to content

Commit 0e541e2

Browse files
committed
Add a test for setting scatter's showLine=true
1 parent 31ffe80 commit 0e541e2

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

test/specs/controller.scatter.test.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,28 @@ describe('Chart.controllers.scatter', function() {
4747
expect(meta.dataset.draw.calls.count()).toBe(0);
4848
expect(meta.data[0].draw.calls.count()).toBe(1);
4949
});
50+
51+
it('should draw a line if true', function() {
52+
var chart = window.acquireChart({
53+
type: 'scatter',
54+
data: {
55+
datasets: [{
56+
data: [{x: 10, y: 15}],
57+
showLine: true,
58+
label: 'dataset1'
59+
}],
60+
},
61+
options: {}
62+
});
63+
64+
var meta = chart.getDatasetMeta(0);
65+
spyOn(meta.dataset, 'draw');
66+
spyOn(meta.data[0], 'draw');
67+
68+
chart.update();
69+
70+
expect(meta.dataset.draw.calls.count()).toBe(1);
71+
expect(meta.data[0].draw.calls.count()).toBe(1);
72+
});
5073
});
5174
});

0 commit comments

Comments
 (0)