mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 04:09:08 +02:00
1c2f66a00e
Introduces a colors plugin that provides a color palette Co-authored-by: Dan Onoshko <danon0404@gmail.com> Co-authored-by: Jacco van den Berg <jaccoberg2281@gmail.com>
37 lines
993 B
JavaScript
37 lines
993 B
JavaScript
import {acquireChart, releaseChart, createMockContext, afterEvent, waitForResize, injectWrapperCSS, specsFromFixtures, triggerMouseEvent, addMatchers, releaseCharts} from 'chartjs-test-utils';
|
|
|
|
// force ratio=1 for tests on high-res/retina devices
|
|
// fixes https://github.com/chartjs/Chart.js/issues/4515
|
|
window.devicePixelRatio = 1;
|
|
|
|
window.acquireChart = acquireChart;
|
|
window.afterEvent = afterEvent;
|
|
window.releaseChart = releaseChart;
|
|
window.waitForResize = waitForResize;
|
|
window.createMockContext = createMockContext;
|
|
|
|
injectWrapperCSS();
|
|
|
|
jasmine.fixture = {
|
|
specs: specsFromFixtures
|
|
};
|
|
|
|
jasmine.triggerMouseEvent = triggerMouseEvent;
|
|
|
|
// Set a fixed time zone (and, in particular, disable Daylight Saving Time) for
|
|
// more stable test results.
|
|
window.moment.tz.setDefault('Etc/UTC');
|
|
|
|
beforeAll(() => {
|
|
// Disable colors plugin for tests.
|
|
window.Chart.defaults.plugins.colors.enabled = false;
|
|
});
|
|
|
|
beforeEach(() => {
|
|
addMatchers();
|
|
});
|
|
|
|
afterEach(() => {
|
|
releaseCharts();
|
|
});
|