File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/components/sectionsWheelPicker Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 1
1
import _ from 'lodash' ;
2
+ import type { ReactTestInstance } from 'react-test-renderer' ;
2
3
import { useComponentDriver , ComponentProps } from '../../testkit/new/Component.driver' ;
3
4
import { WheelPickerDriver } from '../WheelPicker/WheelPicker.driver' ;
4
- import { SectionsWheelPickerProps } from './index' ;
5
+ import type { SectionsWheelPickerProps } from './index' ;
5
6
6
7
export const SectionsWheelPickerDriver = ( props : ComponentProps ) => {
7
8
const driver = useComponentDriver ( props ) ;
8
- const sections = driver . getElement ( ) . children as SectionsWheelPickerProps [ 'sections' ] ;
9
+ const sections = _ . map ( driver . getElement ( ) . children as ReactTestInstance [ ] , ( child ) => child . props ) as SectionsWheelPickerProps [ 'sections' ] ;
9
10
const sectionsDrivers = _ . map ( sections , ( section , index ) => {
10
11
const sectionTestID = `${ props . testID } .${ index } ` ;
11
12
return WheelPickerDriver ( {
12
13
renderTree : props . renderTree ,
13
- testID : section ? .testID || sectionTestID
14
+ testID : section . testID || sectionTestID
14
15
} ) ;
15
16
} ) ;
16
17
return { ...driver , sections, sectionsDrivers} ;
You can’t perform that action at this time.
0 commit comments