2020-12-27 20:29:42 +01:00
|
|
|
import {acquireChart, releaseChart, createMockContext, afterEvent, waitForResize, injectWrapperCSS, specsFromFixtures, triggerMouseEvent, addMatchers, releaseCharts} from 'chartjs-test-utils';
|
2017-03-04 16:47:53 +01:00
|
|
|
|
2020-12-27 20:29:42 +01:00
|
|
|
// force ratio=1 for tests on high-res/retina devices
|
|
|
|
// fixes https://github.com/chartjs/Chart.js/issues/4515
|
|
|
|
window.devicePixelRatio = 1;
|
2017-03-04 16:47:53 +01:00
|
|
|
|
2020-12-27 20:29:42 +01:00
|
|
|
window.acquireChart = acquireChart;
|
|
|
|
window.afterEvent = afterEvent;
|
|
|
|
window.releaseChart = releaseChart;
|
|
|
|
window.waitForResize = waitForResize;
|
|
|
|
window.createMockContext = createMockContext;
|
2017-03-04 16:47:53 +01:00
|
|
|
|
2020-12-27 20:29:42 +01:00
|
|
|
injectWrapperCSS();
|
2017-03-04 16:47:53 +01:00
|
|
|
|
2020-12-27 20:29:42 +01:00
|
|
|
jasmine.fixture = {
|
2021-02-10 14:21:39 +01:00
|
|
|
specs: specsFromFixtures
|
2020-12-27 20:29:42 +01:00
|
|
|
};
|
2017-03-04 16:47:53 +01:00
|
|
|
|
2020-12-27 20:29:42 +01:00
|
|
|
jasmine.triggerMouseEvent = triggerMouseEvent;
|
2017-03-04 16:47:53 +01:00
|
|
|
|
2021-12-06 13:38:39 +01:00
|
|
|
// Set a fixed time zone (and, in particular, disable Daylight Saving Time) for
|
|
|
|
// more stable test results.
|
|
|
|
window.moment.tz.setDefault('Etc/UTC');
|
|
|
|
|
2020-12-27 20:29:42 +01:00
|
|
|
beforeEach(function() {
|
2021-02-10 14:21:39 +01:00
|
|
|
addMatchers();
|
2020-12-27 20:29:42 +01:00
|
|
|
});
|
2017-08-05 16:48:12 +02:00
|
|
|
|
2020-12-27 20:29:42 +01:00
|
|
|
afterEach(function() {
|
2021-02-10 14:21:39 +01:00
|
|
|
releaseCharts();
|
2020-12-27 20:29:42 +01:00
|
|
|
});
|