mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 20:29:12 +02:00
be8d78a900
`controllers.*.js` and `core.datasetController.js` are now importable (no more function export), that's why there is so many changes mainly due to one indentation level removed. Split code for `bar/horizontalBar` and `doughnut/pie` in separate files, added a global controllers import (`src/controllers/index.js`) and add tests to check that all dataset controllers are correctly registered under `chart.controllers.{type}`.
30 lines
706 B
JavaScript
30 lines
706 B
JavaScript
describe('Chart.controllers.scatter', function() {
|
|
it('should be registered as dataset controller', function() {
|
|
expect(typeof Chart.controllers.scatter).toBe('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);
|
|
});
|
|
});
|
|
});
|