Test: Add tests for useSubmitInputInternal
Description
Add unit tests for the useSubmitInputInternal hook to improve coverage and ensure correct input handling, event dispatching, and sensitive input logic.
Closes #350
What change does this PR introduce?
Please select the relevant option(s).
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update (changes to docs/code comments)
What is the proposed approach?
This PR introduces comprehensive Jest tests for the useSubmitInputInternal hook, covering various input scenarios, event handling, and sensitive input cases. This helps ensure the reliability of user input submission flows.
Checklist:
- [x] The commit message follows our adopted guidelines
- [x] Testing has been done for the change(s) added (for bug fixes/features)
- [ ] Relevant comments/docs have been added/updated (for bug fixes/features)
@tjtanjin Could you help me with the failing tests? I went through the logs and as far as I understand the test suite fails due to an invalid element type error in TestChatBotProvider. The root cause is an undefined ChatIcon component in DefaultSettings.tsx or some type of import error. This doesnt really have anything to do with my file. Could you verify once if I am right or am I missing something.
@tjtanjin Could you help me with this. Thank you.
Hey @Suvrat1629, apologies for the late response. I've gone ahead and labelled the PR as hacktoberfest-accepted so that it counts towards the hacktoberfest contribution. I'll keep this PR open until I'm able to properly get back to this 🥹