Open alex-mironov opened 1 year ago
I'm using react-native-testing library for testing the app. In scope of the test I need to fill in the form with proper value in this selector. My attempt to do it like this:
fireEvent(await findByTestId('my-picker', 'onValueChange', 'my-value'))
has failed with error:
TypeError: Cannot read property 'charAt' of undefined
Is there any reliable way to trigger value change inside of the picker from unit tests?
I don't know if you still have the issue, but I was able to solve using this:
const picker = await findByTestId('picker-id'); fireEvent(picker, 'onValueChange', 'my-value');
I'm using react-native-testing library for testing the app. In scope of the test I need to fill in the form with proper value in this selector. My attempt to do it like this:
has failed with error:
Is there any reliable way to trigger value change inside of the picker from unit tests?