File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed
src/components/carousel/__tests__ Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change 1
- import { map } from 'lodash' ;
2
1
import React from 'react' ;
3
2
import { render , fireEvent } from '@testing-library/react-native' ;
4
3
import { Text , View } from 'react-native' ;
5
4
import { Constants } from '../../../helpers' ;
6
5
import Carousel from '../index' ;
7
6
8
- const numberOfPagesShown = 5 ;
9
7
const getEventData = ( { y = 0 , x = 0 } ) => {
10
8
return {
11
9
nativeEvent : {
@@ -24,11 +22,18 @@ const TestCase = props => {
24
22
onScroll = { onScrollMock }
25
23
{ ...props }
26
24
>
27
- { map ( [ ...Array ( numberOfPagesShown ) ] , ( _ , index ) => (
28
- < Page key = { index } >
29
- < Text testID = { `page-${ index } ` } > Page #{ index } </ Text >
30
- </ Page >
31
- ) ) }
25
+ < Page key = { index } >
26
+ < Text testID = { `page-0` } > Page #0</ Text >
27
+ </ Page >
28
+ < Page key = { index } >
29
+ < Text testID = { `page-1` } > Page #1</ Text >
30
+ </ Page >
31
+ < Page key = { index } >
32
+ < Text testID = { `page-2` } > Page #2</ Text >
33
+ </ Page >
34
+ < Page key = { index } >
35
+ < Text testID = { `page-3` } > Page #3</ Text >
36
+ </ Page >
32
37
</ Carousel >
33
38
) ;
34
39
} ;
You can’t perform that action at this time.
0 commit comments