vega-frontend-monorepo/libs/candles-chart/src/setup-tests.ts
macqbat 06e1b3663d
chore: volume in chart enabled by default (#2577)
* chore: volume in chart enabled by default

* chore: volume in chart enabled by default - add unit test
2023-01-12 11:49:57 +01:00

26 lines
526 B
TypeScript

import '@testing-library/jest-dom';
import 'jest-canvas-mock';
import ResizeObserver from 'resize-observer-polyfill';
global.ResizeObserver = ResizeObserver;
global.DOMRect = class DOMRect {
bottom = 0;
left = 0;
right = 0;
top = 0;
constructor(
public x = 0,
public y = 0,
public width = 0,
public height = 0
) {}
static fromRect(other?: DOMRectInit): DOMRect {
return new DOMRect(other?.x, other?.y, other?.width, other?.height);
}
toJSON() {
return JSON.stringify(this);
}
};