This repository was archived by the owner on Sep 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed
Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -13,3 +13,27 @@ jest.mock('react-native-reanimated', () => {
1313
1414// Silence the warning: Animated: `useNativeDriver` is not supported because the native animated module is missing
1515jest . mock ( 'react-native/Libraries/Animated/NativeAnimatedHelper' ) ;
16+
17+ // Mock react-native-date-picker
18+ jest . mock ( 'react-native-date-picker' , ( ) => {
19+ const React = require ( 'react' ) ;
20+ const { View } = require ( 'react-native' ) ;
21+
22+ return React . forwardRef ( ( props , ref ) => {
23+ const { testID, onDateChange, date } = props ;
24+
25+ // Create a mock component that can be interacted with in tests
26+ const handleDateChange = ( newDate ) => {
27+ if ( onDateChange ) {
28+ onDateChange ( newDate ) ;
29+ }
30+ } ;
31+
32+ return React . createElement ( View , {
33+ testID : testID ,
34+ ref : ref ,
35+ onDateChange : handleDateChange ,
36+ date : date ,
37+ } ) ;
38+ } ) ;
39+ } ) ;
Original file line number Diff line number Diff line change @@ -101,8 +101,8 @@ const PBSCPasswordStrength = (props) => {
101101 } ) }
102102 </ View >
103103 < View style = { styles . suggestionsWrapper } >
104- { passwordStrength . suggestions . map ( ( suggestion ) => (
105- < Text > { `${ suggestion } ` } </ Text >
104+ { passwordStrength . suggestions . map ( ( suggestion , index ) => (
105+ < Text key = { index } > { `${ suggestion } ` } </ Text >
106106 ) ) }
107107 </ View >
108108 </ View >
You can’t perform that action at this time.
0 commit comments