eaea6a38ec
* feat: add network switcher dropdown to the trading app * fix: refactor label text * fix: format * fix: paddings * fix: use theme spacing instead of px
30 lines
748 B
TypeScript
30 lines
748 B
TypeScript
// jest-dom adds custom jest matchers for asserting on DOM nodes.
|
|
// allows you to do things like:
|
|
// expect(element).toHaveTextContent(/react/i)
|
|
// learn more: https://github.com/testing-library/jest-dom
|
|
import '@testing-library/jest-dom';
|
|
import ResizeObserver from 'resize-observer-polyfill';
|
|
|
|
global.ResizeObserver = ResizeObserver;
|
|
|
|
// Required by radix-ui/react-dropdown-menu
|
|
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);
|
|
}
|
|
};
|