2018-01-16 10:29:49 +01:00
|
|
|
describe('Chart.controllers.scatter', function() {
|
2020-07-13 19:20:05 +02:00
|
|
|
describe('auto', jasmine.fixture.specs('controller.scatter'));
|
|
|
|
|
2018-11-29 21:06:34 +01:00
|
|
|
it('should be registered as dataset controller', function() {
|
|
|
|
expect(typeof Chart.controllers.scatter).toBe('function');
|
|
|
|
});
|
|
|
|
|
2020-01-14 13:34:08 +01:00
|
|
|
it('should test default tooltip callbacks', function(done) {
|
2019-01-09 14:37:25 +01:00
|
|
|
var chart = window.acquireChart({
|
|
|
|
type: 'scatter',
|
|
|
|
data: {
|
|
|
|
datasets: [{
|
|
|
|
data: [{
|
|
|
|
x: 10,
|
|
|
|
y: 15
|
|
|
|
}],
|
|
|
|
label: 'dataset1'
|
|
|
|
}],
|
|
|
|
},
|
|
|
|
options: {}
|
|
|
|
});
|
|
|
|
var point = chart.getDatasetMeta(0).data[0];
|
|
|
|
|
2020-01-14 13:34:08 +01:00
|
|
|
afterEvent(chart, 'mousemove', function() {
|
|
|
|
// Title should be empty
|
|
|
|
expect(chart.tooltip.title.length).toBe(0);
|
|
|
|
expect(chart.tooltip.body[0].lines).toEqual(['(10, 15)']);
|
|
|
|
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
|
|
|
|
jasmine.triggerMouseEvent(chart, 'mousemove', point);
|
2019-01-09 14:37:25 +01:00
|
|
|
});
|
2018-01-16 10:29:49 +01:00
|
|
|
});
|