Chart.js/test
Ian Ker-Seymer e4dd158b24
Fix out of bounds index access in getLabelMoment
Previously, calling getLabelMoment with an out of bound index would cause an
error such as this:

```
Uncaught TypeError: Cannot read property 'null' of undefined
```

This happens because there is not always guaranteed to be a labelMoment on
at the current datasetIndex.

One example of this is practice comes from a this function call:

```js
// since the are not always guaranteed to be at least two labelMoments
//                                \ / this index can be out of bounds
//                                 |
var tickWidth = me.getPixelForTick(1) - me.getPixelForTick(0) - 6;
```

This patch simply ensures that the `labelMoments` for the `datasetIndex` are
defined before accessing properties on it.
2016-07-26 14:45:05 -04:00
..
controller.bar.tests.js Fix bar and line controllers to convert strings to numbers when considering the values for stacking the chart. Simplified the base calculation for the bar charts and added test coverage to ensure that strings will work correctly. 2016-07-06 18:22:42 -04:00
controller.bubble.tests.js Fix bar, bubble, doughnut, and polarArea tests 2016-04-26 12:46:34 +02:00
controller.doughnut.tests.js Reduce duplicated code in doughnut controller 2016-05-30 21:33:11 -04:00
controller.line.tests.js Fix bar and line controllers to convert strings to numbers when considering the values for stacking the chart. Simplified the base calculation for the bar charts and added test coverage to ensure that strings will work correctly. 2016-07-06 18:22:42 -04:00
controller.polarArea.tests.js Add polar area start angle setting 2016-07-09 09:05:02 -04:00
controller.radar.tests.js Fix radar tests & reenable. support new lineTension attribute like line controller 2016-04-27 19:03:52 -04:00
core.element.tests.js Core element tests 2015-08-30 20:17:24 -04:00
core.helpers.tests.js Suggested changes from PR review 2016-06-03 20:15:29 +01:00
core.layoutService.tests.js Fix legend tests and disable other failing tests 2016-04-27 19:58:36 +02:00
core.legend.tests.js Added usePointStyle option to label boxes 2016-07-05 20:08:29 -06:00
core.plugin.tests.js Allow to register/unregister an array of plugins 2016-06-11 00:17:44 +02:00
core.scaleService.tests.js Allow updating scale defaults 2016-05-07 11:43:24 -04:00
core.title.tests.js Reduce core.title.js size 2016-05-04 21:08:59 -04:00
core.tooltip.tests.js titleColor options is not available 2016-06-08 23:15:21 +09:00
defaultConfig.tests.js Fix test/defaultConfig.tests.js after PR #2308 2016-04-20 16:02:05 +02:00
element.arc.tests.js Arc element tests 2015-08-29 12:31:44 -04:00
element.line.tests.js Can now skip in all cases (start, mid, end) whether or not there is a look 2015-11-15 11:16:41 -05:00
element.point.tests.js Added usePointStyle option to label boxes 2016-07-05 20:08:29 -06:00
element.rectangle.tests.js Added 'borderSkipped' parameter to Rectangle. 2016-03-13 18:58:36 +03:00
mockContext.js Reenable time scale tests 2016-04-27 21:50:31 -04:00
scale.category.tests.js Non numeric y (#2849) 2016-07-09 09:22:25 -06:00
scale.linear.tests.js Fix #2574 - Add support to hide border on the chart 2016-05-17 21:35:19 +02:00
scale.logarithmic.tests.js Fix #2574 - Add support to hide border on the chart 2016-05-17 21:35:19 +02:00
scale.radialLinear.tests.js changed option name for radar chart from offsetAngle to startAngle. Added test to make sure correct angles are computed for all points in the radar chart (with and without startAngle option set). 2016-07-17 23:11:30 -06:00
scale.time.tests.js Fix out of bounds index access in getLabelMoment 2016-07-26 14:45:05 -04:00