MCPcopy Create free account
hub / github.com/bvaughn/react-virtualized / mockLayout

Function mockLayout

lib/utils/test/scrollElement.ts:152–157  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

150
151/** Installs the layout model (see above); it is restored after each test. */
152export function mockLayout() {
153 if (originalGetBoundingClientRect === null) {
154 originalGetBoundingClientRect = Element.prototype.getBoundingClientRect;
155 Element.prototype.getBoundingClientRect = getBoundingClientRect;
156 }
157}
158
159export type ScrollContainer = {
160 /** The scrollable container (to pass as `scrollElement`). */

Callers 2

createScrollContainerFunction · 0.85
mockWindowScrollingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected