MCPcopy
hub / github.com/bvaughn/react-virtualized / getMarkup

Function getMarkup

source/Collection/Collection.jest.js:22–48  ·  view source on GitHub ↗
(props = {})

Source from the content-addressed store, hash-verified

20 }
21
22 function getMarkup(props = {}) {
23 const {cellCount = CELLS.length} = props;
24
25 function defaultCellSizeAndPositionGetter({index}) {
26 index %= cellCount;
27
28 return CELLS[index];
29 }
30
31 return (
32 <Collection
33 cellCount={cellCount}
34 cellRenderer={defaultCellRenderer}
35 cellSizeAndPositionGetter={defaultCellSizeAndPositionGetter}
36 height={SECTION_SIZE}
37 sectionSize={SECTION_SIZE}
38 width={SECTION_SIZE * 2}
39 {...props}
40 />
41 );
42 }
43
44 function simulateScroll({collection, scrollLeft = 0, scrollTop = 0}) {
45 const target = {scrollLeft, scrollTop};
46 collection._collectionView._scrollingContainer = target; // HACK to work around _onScroll target check
47 Simulate.scroll(findDOMNode(collection), {target});
48 }
49
50 function compareArrays(array1, array2) {
51 expect(array1.length).toEqual(array2.length);

Callers 3

Collection.jest.jsFile · 0.70
helperFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…