2020-08-17 16:03:15 +02:00
|
|
|
describe('Chart.element', function() {
|
|
|
|
describe('getProps', function() {
|
|
|
|
it('should return requested properties', function() {
|
|
|
|
const elem = new Chart.Element();
|
|
|
|
elem.x = 10;
|
|
|
|
elem.y = 1.5;
|
|
|
|
|
|
|
|
expect(elem.getProps(['x', 'y'])).toEqual(jasmine.objectContaining({x: 10, y: 1.5}));
|
|
|
|
expect(elem.getProps(['x', 'y'], true)).toEqual(jasmine.objectContaining({x: 10, y: 1.5}));
|
|
|
|
|
2020-12-30 14:31:30 +01:00
|
|
|
elem.$animations = {x: {active: () => true, _to: 20}};
|
2020-08-17 16:03:15 +02:00
|
|
|
expect(elem.getProps(['x', 'y'])).toEqual(jasmine.objectContaining({x: 10, y: 1.5}));
|
|
|
|
expect(elem.getProps(['x', 'y'], true)).toEqual(jasmine.objectContaining({x: 20, y: 1.5}));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|