MCPcopy Create free account
hub / github.com/bvaughn/react-window / getSnapshot

Function getSnapshot

integrations/tests/tests/settle.ts:20–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18 await page.evaluate(
19 async ({ maxFrames, minFrames, stableFrames }) => {
20 const getSnapshot = () => {
21 const scrollPositions = Array.from(
22 document.querySelectorAll(
23 '[data-testid="scroller"], [role="grid"], [role="list"]'
24 )
25 ).map((element) => `${element.scrollLeft},${element.scrollTop}`);
26
27 return [
28 window.scrollX,
29 window.scrollY,
30 ...scrollPositions,
31 document.body.innerHTML
32 ].join("|");
33 };
34
35 // WebKit on Linux (in CI) sometimes stops running animation frames;
36 // don't wait for more than a frame's worth of time (at a low frame rate)

Callers 1

settleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected