packages/tests/__setup__/mockIntersectionObserver.js
/**
 * Set the `isIntersecting` for the IntersectionObserver of a specific element.
 * @param element {Element}
 * @param isIntersecting {boolean}
 */
Set the `isIntersecting` for the IntersectionObserver of a specific element.
@param element {Element}
@param isIntersecting {boolean}
Set the ` isIntersecting ` for the IntersectionObserver of a specific element . @param element { Element } @param isIntersecting { boolean }
function mockIsIntersecting(element, isIntersecting) {
  const observer = intersectionMockInstance(element);
  if (!observer) {
    throw new Error(
      'No IntersectionObserver instance found for element. Is it still mounted in the DOM?'
    );
  }
  const item = observers.get(observer);
  if (item) {
    triggerIntersection([element], isIntersecting, observer, item);
  }
}
function mockIsIntersecting ( element , isIntersecting ) { const observer = intersectionMockInstance ( element ) ; if ( ! observer ) { throw new Error ( 'No IntersectionObserver instance found for element. Is it still mounted in the DOM?' ) ; } const item = observers . get ( observer ) ; if ( item ) { triggerIntersection ( [ element ] , isIntersecting , observer , item ) ; } }
Set the `isIntersecting` for the IntersectionObserver of a specific element.
Set the ` isIntersecting ` for the IntersectionObserver of a specific element .