File: core.element.tests.js

package info (click to toggle)
node-chart.js 3.9.1%2B~0.2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 19,004 kB
  • sloc: javascript: 55,371; sh: 76; makefile: 10
file content (16 lines) | stat: -rw-r--r-- 673 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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}));

      elem.$animations = {x: {active: () => true, _to: 20}};
      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}));
    });
  });
});