Skip to content
This repository was archived by the owner on Sep 22, 2025. It is now read-only.

Commit 3e457bd

Browse files
committed
fix: tests
1 parent 00105f3 commit 3e457bd

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

jest/setup.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff 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
1515
jest.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+
});

src/components/PBSCPasswordStrength.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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>

0 commit comments

Comments
 (0)