mirror of
https://github.com/rive-app/rive-react.git
synced 2025-12-19 01:30:08 +08:00
48 lines
780 B
TypeScript
48 lines
780 B
TypeScript
import '@testing-library/jest-dom';
|
|
|
|
window.IntersectionObserver = class IntersectionObserver {
|
|
readonly root: Element | null;
|
|
|
|
readonly rootMargin: string;
|
|
|
|
readonly thresholds: ReadonlyArray<number>;
|
|
|
|
constructor() {
|
|
this.root = null;
|
|
this.rootMargin = '';
|
|
this.thresholds = [];
|
|
}
|
|
|
|
disconnect() {}
|
|
|
|
observe() {}
|
|
|
|
takeRecords(): IntersectionObserverEntry[] {
|
|
return [];
|
|
}
|
|
|
|
unobserve() {}
|
|
};
|
|
|
|
jest.mock('@rive-app/canvas', () => ({
|
|
Rive: jest.fn().mockImplementation(() => ({
|
|
on: jest.fn(),
|
|
stop: jest.fn(),
|
|
})),
|
|
Layout: jest.fn(),
|
|
Fit: {
|
|
Cover: 'cover',
|
|
},
|
|
Alignment: {
|
|
Center: 'center',
|
|
},
|
|
EventType: {
|
|
Load: 'load',
|
|
},
|
|
StateMachineInputType: {
|
|
Number: 1,
|
|
Boolean: 2,
|
|
Trigger: 3,
|
|
},
|
|
}));
|