export class MockIntersectionObserver {
  public readonly root: Element | Document | null;
  public readonly rootMargin: string;
  public readonly thresholds: ReadonlyArray<number>;
  observe: (target: HTMLElement) => void;
  unobserve: (target: HTMLElement) => void;
  disconnect: () => void;

  // @ts-ignore
  constructor(callback: IntersectionObserverCallback, options?: IntersectionObserverInit) {
    this.root = null;
    this.rootMargin = '0px';
    this.thresholds = [1];
    this.observe = jest.fn;
    this.unobserve = jest.fn;
    this.disconnect = jest.fn;
  }

  takeRecords(): any[] {
    return [];
  }
}
