2018-01-16 10:29:49 +01:00
|
|
|
describe('Chart.controllers.scatter', function() {
|
2018-11-29 21:06:34 +01:00
|
|
|
it('should be registered as dataset controller', function() {
|
|
|
|
expect(typeof Chart.controllers.scatter).toBe('function');
|
|
|
|
});
|
|
|
|
|
2018-01-16 10:29:49 +01:00
|
|
|
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);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|