]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Remove deprecated helpers (#6607)
authorBen McCann <322311+benmccann@users.noreply.github.com>
Sun, 27 Oct 2019 20:33:44 +0000 (13:33 -0700)
committerEvert Timberg <evert.timberg+github@gmail.com>
Sun, 27 Oct 2019 20:33:44 +0000 (16:33 -0400)
src/core/core.helpers.js
src/core/core.ticks.js
src/helpers/helpers.canvas.js
src/helpers/helpers.core.js
src/helpers/helpers.easing.js
src/helpers/helpers.math.js
src/platforms/platform.dom.js
test/specs/core.helpers.tests.js
test/specs/global.deprecations.tests.js [deleted file]

index 33c94799e155c70ac0315cfa9d973cf767320db3..3adbcd392184086ab1f9eacd364c422b0759ec05 100644 (file)
@@ -148,16 +148,6 @@ module.exports = function() {
                return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));
        };
 
-       /**
-        * Provided for backward compatibility, not available anymore
-        * @function Chart.helpers.aliasPixel
-        * @deprecated since version 2.8.0
-        * @todo remove at version 3
-        */
-       helpers.aliasPixel = function(pixelWidth) {
-               return (pixelWidth % 2 === 0) ? 0 : 0.5;
-       };
-
        /**
         * Returns the aligned pixel value to avoid anti-aliasing blur
         * @param {Chart} chart - The chart instance.
@@ -312,7 +302,7 @@ module.exports = function() {
        };
        // Implementation of the nice number algorithm used in determining where axis labels will go
        helpers.niceNum = function(range, round) {
-               var exponent = Math.floor(helpers.log10(range));
+               var exponent = Math.floor(helpers.math.log10(range));
                var fraction = range / Math.pow(10, exponent);
                var niceFraction;
 
@@ -582,21 +572,6 @@ module.exports = function() {
                return longest;
        };
 
-       /**
-        * @deprecated
-        */
-       helpers.numberOfLabelLines = function(arrayOfThings) {
-               var numberOfLines = 1;
-               helpers.each(arrayOfThings, function(thing) {
-                       if (helpers.isArray(thing)) {
-                               if (thing.length > numberOfLines) {
-                                       numberOfLines = thing.length;
-                               }
-                       }
-               });
-               return numberOfLines;
-       };
-
        helpers.color = !color ?
                function(value) {
                        console.error('Color.js not found!');
index d9049fd2f90c6aae9aecf1b8a0b001a9192b6ebe..da1c14fb3a1a092d85d77e428d2002bf449d8ed3 100644 (file)
@@ -1,6 +1,7 @@
 'use strict';
 
 var helpers = require('../helpers/index');
+var math = helpers.math;
 
 /**
  * Namespace to hold static tick generation functions
@@ -42,13 +43,13 @@ module.exports = {
                                }
                        }
 
-                       var logDelta = helpers.log10(Math.abs(delta));
+                       var logDelta = math.log10(Math.abs(delta));
                        var tickString = '';
 
                        if (tickValue !== 0) {
                                var maxTick = Math.max(Math.abs(ticks[0]), Math.abs(ticks[ticks.length - 1]));
                                if (maxTick < 1e-4) { // all ticks are small numbers; use scientific notation
-                                       var logTick = helpers.log10(Math.abs(tickValue));
+                                       var logTick = math.log10(Math.abs(tickValue));
                                        var numExponential = Math.floor(logTick) - Math.floor(logDelta);
                                        numExponential = Math.max(Math.min(numExponential, 20), 0);
                                        tickString = tickValue.toExponential(numExponential);
@@ -65,7 +66,7 @@ module.exports = {
                },
 
                logarithmic: function(tickValue, index, ticks) {
-                       var remain = tickValue / (Math.pow(10, Math.floor(helpers.log10(tickValue))));
+                       var remain = tickValue / (Math.pow(10, Math.floor(math.log10(tickValue))));
 
                        if (tickValue === 0) {
                                return '0';
index 00950f5621f4b0286b1fa57d9b68213bea30b05b..221e7de2cad555f119f5431c7a60e593851027aa 100644 (file)
@@ -1,7 +1,5 @@
 'use strict';
 
-var helpers = require('./helpers.core');
-
 var PI = Math.PI;
 var RAD_PER_DEG = PI / 180;
 var DOUBLE_PI = PI * 2;
@@ -233,26 +231,3 @@ var exports = {
 };
 
 module.exports = exports;
-
-// DEPRECATIONS
-
-/**
- * Provided for backward compatibility, use Chart.helpers.canvas.clear instead.
- * @namespace Chart.helpers.clear
- * @deprecated since version 2.7.0
- * @todo remove at version 3
- * @private
- */
-helpers.clear = exports.clear;
-
-/**
- * Provided for backward compatibility, use Chart.helpers.canvas.roundedRect instead.
- * @namespace Chart.helpers.drawRoundedRectangle
- * @deprecated since version 2.7.0
- * @todo remove at version 3
- * @private
- */
-helpers.drawRoundedRectangle = function(ctx) {
-       ctx.beginPath();
-       exports.roundedRect.apply(exports, arguments);
-};
index 350a207509124a4aa64747c8fad72ac6b48dea8a..f9c5a04087783e422e6096c65cc1a3d9e2d40bdc 100644 (file)
@@ -317,44 +317,3 @@ var helpers = {
 };
 
 module.exports = helpers;
-
-// DEPRECATIONS
-
-/**
- * Provided for backward compatibility, use Chart.helpers.callback instead.
- * @function Chart.helpers.callCallback
- * @deprecated since version 2.6.0
- * @todo remove at version 3
- * @private
- */
-helpers.callCallback = helpers.callback;
-
-/**
- * Provided for backward compatibility, use Array.prototype.indexOf instead.
- * Array.prototype.indexOf compatibility: Chrome, Opera, Safari, FF1.5+, IE9+
- * @function Chart.helpers.indexOf
- * @deprecated since version 2.7.0
- * @todo remove at version 3
- * @private
- */
-helpers.indexOf = function(array, item, fromIndex) {
-       return Array.prototype.indexOf.call(array, item, fromIndex);
-};
-
-/**
- * Provided for backward compatibility, use Chart.helpers.valueOrDefault instead.
- * @function Chart.helpers.getValueOrDefault
- * @deprecated since version 2.7.0
- * @todo remove at version 3
- * @private
- */
-helpers.getValueOrDefault = helpers.valueOrDefault;
-
-/**
- * Provided for backward compatibility, use Chart.helpers.valueAtIndexOrDefault instead.
- * @function Chart.helpers.getValueAtIndexOrDefault
- * @deprecated since version 2.7.0
- * @todo remove at version 3
- * @private
- */
-helpers.getValueAtIndexOrDefault = helpers.valueAtIndexOrDefault;
index 603e3f7f7ba2a97db4689291a09fba5f1665d302..350f61f0fbf4ffc2a97a288cd377fa814903b44e 100644 (file)
@@ -1,10 +1,8 @@
 'use strict';
 
-var helpers = require('./helpers.core');
-
 /**
  * Easing functions adapted from Robert Penner's easing equations.
- * @namespace Chart.helpers.easingEffects
+ * @namespace Chart.helpers.effects
  * @see http://www.robertpenner.com/easing/
  */
 var effects = {
@@ -237,14 +235,3 @@ var effects = {
 module.exports = {
        effects: effects
 };
-
-// DEPRECATIONS
-
-/**
- * Provided for backward compatibility, use Chart.helpers.easing.effects instead.
- * @function Chart.helpers.easingEffects
- * @deprecated since version 2.7.0
- * @todo remove at version 3
- * @private
- */
-helpers.easingEffects = effects;
index f2b2b6f014891c36a3d779a2e6481f460e6901ed..4cf45f9b86952bbec419f14e478ee001c28af083 100644 (file)
@@ -1,7 +1,5 @@
 'use strict';
 
-var helpers = require('./helpers.core');
-
 /**
  * @alias Chart.helpers.math
  * @namespace
@@ -44,14 +42,3 @@ var exports = {
 };
 
 module.exports = exports;
-
-// DEPRECATIONS
-
-/**
- * Provided for backward compatibility, use Chart.helpers.math.log10 instead.
- * @namespace Chart.helpers.log10
- * @deprecated since version 2.9.0
- * @todo remove at version 3
- * @private
- */
-helpers.log10 = exports.log10;
index 03f8486be43777af88d336b0577cc17e417203ab..b1964a32a2c38fc6163ed3395b6649da411b7320 100644 (file)
@@ -446,27 +446,3 @@ module.exports = {
                removeListener(canvas, type, proxy);
        }
 };
-
-// DEPRECATIONS
-
-/**
- * Provided for backward compatibility, use EventTarget.addEventListener instead.
- * EventTarget.addEventListener compatibility: Chrome, Opera 7, Safari, FF1.5+, IE9+
- * @see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
- * @function Chart.helpers.addEvent
- * @deprecated since version 2.7.0
- * @todo remove at version 3
- * @private
- */
-helpers.addEvent = addListener;
-
-/**
- * Provided for backward compatibility, use EventTarget.removeEventListener instead.
- * EventTarget.removeEventListener compatibility: Chrome, Opera 7, Safari, FF1.5+, IE9+
- * @see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener
- * @function Chart.helpers.removeEvent
- * @deprecated since version 2.7.0
- * @todo remove at version 3
- * @private
- */
-helpers.removeEvent = removeListener;
index e6ade2bd76a5cd5e8b50b6fa71c9a7311621b68d..39f405d3236d2dbe7b0dea081f76eb808771df77 100644 (file)
@@ -378,17 +378,6 @@ describe('Core helper tests', function() {
                }]);
        });
 
-       it('count look at all the labels and return maximum number of lines', function() {
-               window.createMockContext();
-               var arrayOfThings1 = ['Foo', 'Bar'];
-               var arrayOfThings2 = [['Foo', 'Bar'], 'Foo'];
-               var arrayOfThings3 = [['Foo', 'Bar', 'Boo'], ['Foo', 'Bar'], 'Foo'];
-
-               expect(helpers.numberOfLabelLines(arrayOfThings1)).toEqual(1);
-               expect(helpers.numberOfLabelLines(arrayOfThings2)).toEqual(2);
-               expect(helpers.numberOfLabelLines(arrayOfThings3)).toEqual(3);
-       });
-
        it ('should get the maximum width and height for a node', function() {
                // Create div with fixed size as a test bed
                var div = document.createElement('div');
diff --git a/test/specs/global.deprecations.tests.js b/test/specs/global.deprecations.tests.js
deleted file mode 100644 (file)
index b5509a3..0000000
+++ /dev/null
@@ -1,469 +0,0 @@
-describe('Deprecations', function() {
-       describe('Version 2.9.0', function() {
-               describe('Chart.Scale.mergeTicksOptions', function() {
-                       it('should be defined as a function', function() {
-                               expect(typeof Chart.Scale.prototype.mergeTicksOptions).toBe('function');
-                       });
-               });
-       });
-
-       describe('Version 2.8.0', function() {
-               [
-                       ['Bar', 'bar'],
-                       ['Bubble', 'bubble'],
-                       ['Doughnut', 'doughnut'],
-                       ['Line', 'line'],
-                       ['PolarArea', 'polarArea'],
-                       ['Radar', 'radar'],
-                       ['Scatter', 'scatter']
-               ].forEach(function(descriptor) {
-                       var klass = descriptor[0];
-                       var type = descriptor[1];
-
-                       describe('Chart.' + klass, function() {
-                               it('should be defined as a function', function() {
-                                       expect(typeof Chart[klass]).toBe('function');
-                               });
-                               it('should create a chart of type "' + type + '"', function() {
-                                       var chart = new Chart[klass]('foo', {data: {}});
-                                       expect(chart instanceof Chart.Controller).toBeTruthy();
-                                       expect(chart.config.type).toBe(type);
-                               });
-                       });
-               });
-
-               describe('Chart.Chart', function() {
-                       it('should be defined as an alias to Chart', function() {
-                               expect(Chart.Chart).toBe(Chart);
-                       });
-               });
-
-               describe('Chart.helpers.aliasPixel', function() {
-                       it('should be defined as a function', function() {
-                               expect(typeof Chart.helpers.aliasPixel).toBe('function');
-                       });
-               });
-
-               describe('Chart.LinearScaleBase', function() {
-                       it('should be defined and inherit from Chart.Scale', function() {
-                               expect(typeof Chart.LinearScaleBase).toBe('function');
-                               expect(Chart.LinearScaleBase.prototype instanceof Chart.Scale).toBeTruthy();
-                       });
-               });
-
-               describe('Chart.types', function() {
-                       it('should be defined as an empty object', function() {
-                               expect(Chart.types).toEqual({});
-                       });
-               });
-
-               describe('Chart.helpers.configMerge', function() {
-                       it('should be defined as a function', function() {
-                               expect(typeof Chart.helpers.configMerge).toBe('function');
-                       });
-               });
-
-               describe('Chart.helpers.scaleMerge', function() {
-                       it('should be defined as a function', function() {
-                               expect(typeof Chart.helpers.scaleMerge).toBe('function');
-                       });
-               });
-       });
-
-       describe('Version 2.7.3', function() {
-               describe('Chart.layoutService', function() {
-                       it('should be defined and an alias of Chart.layouts', function() {
-                               expect(Chart.layoutService).toBeDefined();
-                               expect(Chart.layoutService).toBe(Chart.layouts);
-                       });
-               });
-       });
-
-       describe('Version 2.7.0', function() {
-               describe('Chart.Controller.update(duration, lazy)', function() {
-                       it('should add an animation with the provided options', function() {
-                               var chart = acquireChart({
-                                       type: 'doughnut',
-                                       options: {
-                                               animation: {
-                                                       easing: 'linear',
-                                                       duration: 500
-                                               }
-                                       }
-                               });
-
-                               spyOn(Chart.animationService, 'addAnimation');
-
-                               chart.update(800, false);
-
-                               expect(Chart.animationService.addAnimation).toHaveBeenCalledWith(
-                                       chart,
-                                       jasmine.objectContaining({easing: 'linear'}),
-                                       800,
-                                       false
-                               );
-                       });
-               });
-
-               describe('Chart.Controller.render(duration, lazy)', function() {
-                       it('should add an animation with the provided options', function() {
-                               var chart = acquireChart({
-                                       type: 'doughnut',
-                                       options: {
-                                               animation: {
-                                                       easing: 'linear',
-                                                       duration: 500
-                                               }
-                                       }
-                               });
-
-                               spyOn(Chart.animationService, 'addAnimation');
-
-                               chart.render(800, true);
-
-                               expect(Chart.animationService.addAnimation).toHaveBeenCalledWith(
-                                       chart,
-                                       jasmine.objectContaining({easing: 'linear'}),
-                                       800,
-                                       true
-                               );
-                       });
-               });
-
-               describe('Chart.helpers.indexOf', function() {
-                       it('should be defined and a function', function() {
-                               expect(typeof Chart.helpers.indexOf).toBe('function');
-                       });
-                       it('should returns the correct index', function() {
-                               expect(Chart.helpers.indexOf([1, 2, 42], 42)).toBe(2);
-                               expect(Chart.helpers.indexOf([1, 2, 42], 3)).toBe(-1);
-                               expect(Chart.helpers.indexOf([1, 42, 2, 42], 42, 2)).toBe(3);
-                               expect(Chart.helpers.indexOf([1, 42, 2, 42], 3, 2)).toBe(-1);
-                       });
-               });
-
-               describe('Chart.helpers.clear', function() {
-                       it('should be defined and an alias of Chart.helpers.canvas.clear', function() {
-                               expect(Chart.helpers.clear).toBeDefined();
-                               expect(Chart.helpers.clear).toBe(Chart.helpers.canvas.clear);
-                       });
-               });
-
-               describe('Chart.helpers.getValueOrDefault', function() {
-                       it('should be defined and an alias of Chart.helpers.valueOrDefault', function() {
-                               expect(Chart.helpers.getValueOrDefault).toBeDefined();
-                               expect(Chart.helpers.getValueOrDefault).toBe(Chart.helpers.valueOrDefault);
-                       });
-               });
-
-               describe('Chart.helpers.getValueAtIndexOrDefault', function() {
-                       it('should be defined and an alias of Chart.helpers.valueAtIndexOrDefault', function() {
-                               expect(Chart.helpers.getValueAtIndexOrDefault).toBeDefined();
-                               expect(Chart.helpers.getValueAtIndexOrDefault).toBe(Chart.helpers.valueAtIndexOrDefault);
-                       });
-               });
-
-               describe('Chart.helpers.easingEffects', function() {
-                       it('should be defined and an alias of Chart.helpers.easing.effects', function() {
-                               expect(Chart.helpers.easingEffects).toBeDefined();
-                               expect(Chart.helpers.easingEffects).toBe(Chart.helpers.easing.effects);
-                       });
-               });
-
-               describe('Chart.helpers.drawRoundedRectangle', function() {
-                       it('should be defined and a function', function() {
-                               expect(typeof Chart.helpers.drawRoundedRectangle).toBe('function');
-                       });
-                       it('should call Chart.helpers.canvas.roundedRect', function() {
-                               var ctx = window.createMockContext();
-                               spyOn(Chart.helpers.canvas, 'roundedRect');
-
-                               Chart.helpers.drawRoundedRectangle(ctx, 10, 20, 30, 40, 5);
-
-                               var calls = ctx.getCalls();
-                               expect(calls[0]).toEqual({name: 'beginPath', args: []});
-                               expect(Chart.helpers.canvas.roundedRect).toHaveBeenCalledWith(ctx, 10, 20, 30, 40, 5);
-                       });
-               });
-
-               describe('Chart.helpers.addEvent', function() {
-                       it('should be defined and a function', function() {
-                               expect(typeof Chart.helpers.addEvent).toBe('function');
-                       });
-                       it('should correctly add event listener', function() {
-                               var listener = jasmine.createSpy('spy');
-                               Chart.helpers.addEvent(window, 'test', listener);
-                               window.dispatchEvent(new Event('test'));
-                               expect(listener).toHaveBeenCalled();
-                       });
-               });
-
-               describe('Chart.helpers.removeEvent', function() {
-                       it('should be defined and a function', function() {
-                               expect(typeof Chart.helpers.removeEvent).toBe('function');
-                       });
-                       it('should correctly remove event listener', function() {
-                               var listener = jasmine.createSpy('spy');
-                               Chart.helpers.addEvent(window, 'test', listener);
-                               Chart.helpers.removeEvent(window, 'test', listener);
-                               window.dispatchEvent(new Event('test'));
-                               expect(listener).not.toHaveBeenCalled();
-                       });
-               });
-       });
-
-       describe('Version 2.6.0', function() {
-               // https://github.com/chartjs/Chart.js/issues/2481
-               describe('Chart.Controller', function() {
-                       it('should be defined and an alias of Chart', function() {
-                               expect(Chart.Controller).toBeDefined();
-                               expect(Chart.Controller).toBe(Chart);
-                       });
-                       it('should be prototype of chart instances', function() {
-                               var chart = acquireChart({});
-                               expect(chart.constructor).toBe(Chart.Controller);
-                               expect(chart instanceof Chart.Controller).toBeTruthy();
-                               expect(Chart.Controller.prototype.isPrototypeOf(chart)).toBeTruthy();
-                       });
-               });
-
-               describe('chart.chart', function() {
-                       it('should be defined and an alias of chart', function() {
-                               var chart = acquireChart({});
-                               var proxy = chart.chart;
-                               expect(proxy).toBeDefined();
-                               expect(proxy).toBe(chart);
-                       });
-                       it('should defined previously existing properties', function() {
-                               var chart = acquireChart({}, {
-                                       canvas: {
-                                               style: 'width: 140px; height: 320px'
-                                       }
-                               });
-
-                               var proxy = chart.chart;
-                               expect(proxy.config instanceof Object).toBeTruthy();
-                               expect(proxy.controller instanceof Chart.Controller).toBeTruthy();
-                               expect(proxy.canvas instanceof HTMLCanvasElement).toBeTruthy();
-                               expect(proxy.ctx instanceof CanvasRenderingContext2D).toBeTruthy();
-                               expect(proxy.currentDevicePixelRatio).toBe(window.devicePixelRatio || 1);
-                               expect(proxy.aspectRatio).toBe(140 / 320);
-                               expect(proxy.height).toBe(320);
-                               expect(proxy.width).toBe(140);
-                       });
-               });
-
-               describe('Chart.Animation.animationObject', function() {
-                       it('should be defined and an alias of Chart.Animation', function(done) {
-                               var animation = null;
-
-                               acquireChart({
-                                       options: {
-                                               animation: {
-                                                       duration: 50,
-                                                       onComplete: function(arg) {
-                                                               animation = arg;
-                                                       }
-                                               }
-                                       }
-                               });
-
-                               setTimeout(function() {
-                                       expect(animation).not.toBeNull();
-                                       expect(animation.animationObject).toBeDefined();
-                                       expect(animation.animationObject).toBe(animation);
-                                       done();
-                               }, 200);
-                       });
-               });
-
-               describe('Chart.Animation.chartInstance', function() {
-                       it('should be defined and an alias of Chart.Animation.chart', function(done) {
-                               var animation = null;
-                               var chart = acquireChart({
-                                       options: {
-                                               animation: {
-                                                       duration: 50,
-                                                       onComplete: function(arg) {
-                                                               animation = arg;
-                                                       }
-                                               }
-                                       }
-                               });
-
-                               setTimeout(function() {
-                                       expect(animation).not.toBeNull();
-                                       expect(animation.chartInstance).toBeDefined();
-                                       expect(animation.chartInstance).toBe(chart);
-                                       done();
-                               }, 200);
-                       });
-               });
-
-               describe('Chart.elements.Line: fill option', function() {
-                       it('should decode "zero", "top" and "bottom" as "origin", "start" and "end"', function() {
-                               var chart = window.acquireChart({
-                                       type: 'line',
-                                       data: {
-                                               datasets: [
-                                                       {fill: 'zero'},
-                                                       {fill: 'bottom'},
-                                                       {fill: 'top'},
-                                               ]
-                                       }
-                               });
-
-                               ['origin', 'start', 'end'].forEach(function(expected, index) {
-                                       var meta = chart.getDatasetMeta(index);
-                                       expect(meta.$filler).toBeDefined();
-                                       expect(meta.$filler.fill).toBe(expected);
-                               });
-                       });
-               });
-
-               describe('Chart.helpers.callCallback', function() {
-                       it('should be defined and an alias of Chart.helpers.callback', function() {
-                               expect(Chart.helpers.callCallback).toBeDefined();
-                               expect(Chart.helpers.callCallback).toBe(Chart.helpers.callback);
-                       });
-               });
-
-               describe('Time Axis: unitStepSize option', function() {
-                       it('should use the stepSize property', function() {
-                               var chart = window.acquireChart({
-                                       type: 'line',
-                                       data: {
-                                               labels: ['2015-01-01T20:00:00', '2015-01-01T21:00:00'],
-                                       },
-                                       options: {
-                                               scales: {
-                                                       xAxes: [{
-                                                               id: 'time',
-                                                               type: 'time',
-                                                               bounds: 'ticks',
-                                                               time: {
-                                                                       unit: 'hour',
-                                                                       unitStepSize: 2
-                                                               }
-                                                       }]
-                                               }
-                                       }
-                               });
-
-                               var ticks = chart.scales.time.getTicks().map(function(tick) {
-                                       return tick.label;
-                               });
-
-                               expect(ticks).toEqual(['8PM', '10PM']);
-                       });
-               });
-       });
-
-       describe('Version 2.5.0', function() {
-               describe('Chart.PluginBase', function() {
-                       it('should exist and extendable', function() {
-                               expect(Chart.PluginBase).toBeDefined();
-                               expect(Chart.PluginBase.extend).toBeDefined();
-                       });
-               });
-
-               describe('IPlugin.afterScaleUpdate', function() {
-                       it('should be called after the chart as been layed out', function() {
-                               var sequence = [];
-                               var plugin = {};
-                               var hooks = [
-                                       'beforeLayout',
-                                       'afterScaleUpdate',
-                                       'afterLayout'
-                               ];
-
-                               var override = Chart.layouts.update;
-                               Chart.layouts.update = function() {
-                                       sequence.push('layoutUpdate');
-                                       override.apply(this, arguments);
-                               };
-
-                               hooks.forEach(function(name) {
-                                       plugin[name] = function() {
-                                               sequence.push(name);
-                                       };
-                               });
-
-                               window.acquireChart({plugins: [plugin]});
-                               expect(sequence).toEqual([].concat(
-                                       'beforeLayout',
-                                       'layoutUpdate',
-                                       'afterScaleUpdate',
-                                       'afterLayout'
-                               ));
-                       });
-               });
-       });
-
-       describe('Version 2.4.0', function() {
-               describe('x-axis mode', function() {
-                       it ('behaves like index mode with intersect: false', function() {
-                               var data = {
-                                       datasets: [{
-                                               label: 'Dataset 1',
-                                               data: [10, 20, 30],
-                                               pointHoverBorderColor: 'rgb(255, 0, 0)',
-                                               pointHoverBackgroundColor: 'rgb(0, 255, 0)'
-                                       }, {
-                                               label: 'Dataset 2',
-                                               data: [40, 40, 40],
-                                               pointHoverBorderColor: 'rgb(0, 0, 255)',
-                                               pointHoverBackgroundColor: 'rgb(0, 255, 255)'
-                                       }],
-                                       labels: ['Point 1', 'Point 2', 'Point 3']
-                               };
-
-                               var chart = window.acquireChart({
-                                       type: 'line',
-                                       data: data
-                               });
-                               var meta0 = chart.getDatasetMeta(0);
-                               var meta1 = chart.getDatasetMeta(1);
-
-                               var evt = {
-                                       type: 'click',
-                                       chart: chart,
-                                       native: true, // needed otherwise things its a DOM event
-                                       x: 0,
-                                       y: 0
-                               };
-
-                               var elements = Chart.Interaction.modes['x-axis'](chart, evt);
-                               expect(elements).toEqual([meta0.data[0], meta1.data[0]]);
-                       });
-               });
-       });
-
-       describe('Version 2.1.5', function() {
-               // https://github.com/chartjs/Chart.js/pull/2752
-               describe('Chart.pluginService', function() {
-                       it('should be defined and an alias of Chart.plugins', function() {
-                               expect(Chart.pluginService).toBeDefined();
-                               expect(Chart.pluginService).toBe(Chart.plugins);
-                       });
-               });
-
-               describe('Chart.Legend', function() {
-                       it('should be defined and an instance of Chart.Element', function() {
-                               var legend = new Chart.Legend({});
-                               expect(Chart.Legend).toBeDefined();
-                               expect(legend).not.toBe(undefined);
-                               expect(legend instanceof Chart.Element).toBeTruthy();
-                       });
-               });
-
-               describe('Chart.Title', function() {
-                       it('should be defined and an instance of Chart.Element', function() {
-                               var title = new Chart.Title({});
-                               expect(Chart.Title).toBeDefined();
-                               expect(title).not.toBe(undefined);
-                               expect(title instanceof Chart.Element).toBeTruthy();
-                       });
-               });
-       });
-});