MCPcopy
hub / github.com/thebuilder/react-intersection-observer / mockAllIsIntersecting

Function mockAllIsIntersecting

src/test-utils.ts:235–245  ·  view source on GitHub ↗
(isIntersecting: boolean | number)

Source from the content-addressed store, hash-verified

233 * @param isIntersecting {boolean | number}
234 */
235export function mockAllIsIntersecting(isIntersecting: boolean | number) {
236 warnOnMissingSetup();
237 for (const [observer, item] of observers) {
238 triggerIntersection(
239 Array.from(item.elements),
240 isIntersecting,
241 observer,
242 item,
243 );
244 }
245}
246
247/**
248 * Set the `isIntersecting` for the IntersectionObserver of a specific element.

Callers 4

useInView.test.tsxFile · 0.90
InView.test.tsxFile · 0.90
setup.test.tsFile · 0.90

Calls 2

warnOnMissingSetupFunction · 0.85
triggerIntersectionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…