Skip to content

Commit

Permalink
Add tests related to showLines for controller.scatter (chartjs#5150)
Browse files Browse the repository at this point in the history
  • Loading branch information
loicbourgois authored and simonbrunel committed Jan 16, 2018
1 parent 56a8122 commit e9fe275
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/specs/controller.scatter.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
describe('Chart.controllers.scatter', function() {
describe('showLines option', function() {
it('should not draw a line if undefined', function() {
var chart = window.acquireChart({
type: 'scatter',
data: {
datasets: [{
data: [{x: 10, y: 15}],
label: 'dataset1'
}],
},
options: {}
});

var meta = chart.getDatasetMeta(0);
spyOn(meta.dataset, 'draw');
spyOn(meta.data[0], 'draw');

chart.update();

expect(meta.dataset.draw.calls.count()).toBe(0);
expect(meta.data[0].draw.calls.count()).toBe(1);
});
});
});

0 comments on commit e9fe275

Please sign in to comment.