(props = {})
| 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); |
no outgoing calls
no test coverage detected
searching dependent graphs…