Skip to content

Commit

Permalink
Add a test for setting scatter's showLine=true
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Jan 24, 2019
1 parent 31ffe80 commit 0e541e2
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/specs/controller.scatter.test.js
Expand Up @@ -47,5 +47,28 @@ describe('Chart.controllers.scatter', function() {
expect(meta.dataset.draw.calls.count()).toBe(0);
expect(meta.data[0].draw.calls.count()).toBe(1);
});

it('should draw a line if true', function() {
var chart = window.acquireChart({
type: 'scatter',
data: {
datasets: [{
data: [{x: 10, y: 15}],
showLine: true,
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(1);
expect(meta.data[0].draw.calls.count()).toBe(1);
});
});
});

0 comments on commit 0e541e2

Please sign in to comment.