[v4] | [v2] Issue in resolving the test case for BottomSheetTextInput.
See original GitHub issueWhile trying to provide the test cases for the application I have been having difficulty mocking the call for BottomSheetTextInput
. I’m using the initial mock that was provided in the earlier version (Thanks a lot for that):
I try to mock for the BottomSheetTextInput
something like this:
jest.mock('@gorhom/bottom-sheet', () => {
const MockBottomSheet = require('@gorhom/bottom-sheet/mock');
const originalModule = jest.requireActual('@gorhom/bottom-sheet');
return {
__esModule: true,
BottomSheetTextInput: originalModule.BottomSheetTextInput,
...MockBottomSheet,
};
});
still facing an issue of thrown: "'useBottomSheetInternal' cannot be used out of the BottomSheet!"
Which I’m unable to resolve. It would be amazing if you can look into this issue by providing a mock implementation for this problem.
Environment info
Library | Version |
---|---|
@gorhom/bottom-sheet | ^4.3.1 |
react-native | 0.67.3 |
react-native | 17.0.2 |
react-native-gesture-handler | ^2.4.2 |
Steps To Reproduce
- Implement the bottom sheets component and it contains bottomsheetinputtext.
Describe what you expected to happen:
- resolving the issue that I’m getting for bottom sheet test case.
Reproducible sample code
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:6
Top Results From Across the Web
Unable to run a single unit test case through Test Explorer
In our unit test projects, we use NUnit 3.10 with the TestCase attribute. ... The only way to resolve the issue is to...
Read more >Writing and running tests - Django documentation
When you run your tests, the default behavior of the test utility is to find all the test cases (that is, subclasses of...
Read more >Keyboard Handling | React Native Bottom Sheet - GitHub Pages
To handle the keyboard appearance, I have simplified the approach by creating a pre-integrated TextInput called BottomSheetTextInput, which communicate ...
Read more >What is Test Data? Test Data Preparation Techniques with ...
In this tutorial, I will provide tips on how to prepare test data so any important test case will not be missed by...
Read more >upgrade test planning guide - Aras Community
Chapter 4 contains a reference to a set of sample test cases that you can use ... cases should not start until those...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Following @pedrorestrepo’s comment here, this is what I did to get the mock working:
@developius I do mock the same way right now, but I’m getting an error when I have the sheets that use
BottomSheetTextInput.
I t would be nice thatBottomSheetTextInput
is included in the mockup.