()
| 107 | describe('inextensible data', function() { |
| 108 | it('should handle a frozen data object', function() { |
| 109 | function createChart() { |
| 110 | var data = Object.freeze([0, 1, 2, 3, 4, 5]); |
| 111 | expect(Object.isExtensible(data)).toBeFalsy(); |
| 112 | |
| 113 | var chart = acquireChart({ |
| 114 | type: 'line', |
| 115 | data: { |
| 116 | datasets: [{ |
| 117 | data: data |
| 118 | }] |
| 119 | } |
| 120 | }); |
| 121 | |
| 122 | var dataset = chart.data.datasets[0]; |
| 123 | dataset.data = Object.freeze([5, 4, 3, 2, 1, 0]); |
| 124 | expect(Object.isExtensible(dataset.data)).toBeFalsy(); |
| 125 | chart.update(); |
| 126 | |
| 127 | // Tests that the unlisten path also works for frozen objects |
| 128 | chart.destroy(); |
| 129 | } |
| 130 | |
| 131 | expect(createChart).not.toThrow(); |
| 132 | }); |
no test coverage detected