Skip to content

Commit

Permalink
Add tests related to showLines for controller.scatter (#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 e585c75 commit 6d58a6a
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/specs/controller.scatter.test.js
@@ -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 6d58a6a

Please sign in to comment.