2015-08-29 20:16:37 +02:00
|
|
|
// Tests for the line element
|
2020-10-20 14:18:56 +02:00
|
|
|
describe('Chart.elements.LineElement', function() {
|
2019-11-12 19:59:29 +01:00
|
|
|
describe('auto', jasmine.fixture.specs('element.line'));
|
|
|
|
|
2015-10-24 09:23:51 +02:00
|
|
|
it('should be constructed', function() {
|
2020-10-20 14:18:56 +02:00
|
|
|
var line = new Chart.elements.LineElement({
|
2019-12-31 18:56:15 +01:00
|
|
|
points: [1, 2, 3, 4]
|
2015-08-29 20:16:37 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
expect(line).not.toBe(undefined);
|
2019-12-31 18:56:15 +01:00
|
|
|
expect(line.points).toEqual([1, 2, 3, 4]);
|
2015-08-29 20:16:37 +02:00
|
|
|
});
|
2021-01-16 20:06:27 +01:00
|
|
|
|
|
|
|
it('should not cache path when animations are enabled', function(done) {
|
|
|
|
var chart = window.acquireChart({
|
|
|
|
type: 'line',
|
|
|
|
data: {
|
|
|
|
datasets: [{
|
|
|
|
data: [0, -1, 0],
|
|
|
|
label: 'dataset1',
|
|
|
|
}],
|
|
|
|
labels: ['label1', 'label2', 'label3']
|
|
|
|
},
|
|
|
|
options: {
|
|
|
|
animation: {
|
|
|
|
duration: 50,
|
|
|
|
onComplete: () => {
|
|
|
|
expect(chart.getDatasetMeta(0).dataset._path).toBeUndefined();
|
|
|
|
done();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
2016-10-16 23:34:59 +02:00
|
|
|
});
|