-
Notifications
You must be signed in to change notification settings - Fork 85
Add unit and Espresso tests for Enter key behavior in KeyboardTest.kt #478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Thank you for the pull request! ❤️The Scribe-Android team will do our best to address your contribution as soon as we can. If you're not already a member of our public Matrix community, please consider joining! We'd suggest that you use the Element client as well as Element X for a mobile app, and definitely join the |
Maintainer ChecklistThe following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :)
|
Thanks so much for the PR, @Kota-Jagadeesh! Would be great if you can look into the instrumentation tests as well as the Ktlint and Detekt errors. Please let us know if there's anything we can do to support! :) |
Yeah sure 👍 |
Just checking in. Could you fix those linting issues and then we could have a check and merge this in : ) |
Yeah, Fixed all the lint issues.
|
This PR improvees the keyboard's reliability by adding a full set of unit tests for the KeyHandler class. It includes a fix for the Enter key issue, ensuering it correctly inserts a new line. I've also added comprehensive tests for the backspace key to ensure it works correctly in all states, and new tests to prevent crashes with null inputs. |
Signed-off-by: angrezichatterbox <gouthammohanraj@gmail.com>
Could you base the enter key tests on basis of the IME actions like search or note application so that depending on the application it fulfills the purpose like adding a new line sending a message or searching. |
@angrezichatterbox Updated the PR, please review it : ) Changes Made
Testing
Fixes #440 |
Thanks so much for your efforts to finalize this, @Kota-Jagadeesh! |
@angrezichatterbox Thanks for tha feedback! I've made the updates you requested.
All tha tests are passed. Ready for your review! |
The tests I meant was Junit Parametrized tests. Could you look into that. |
Contributor checklist
./gradlew lintKotlin detekt test
command as directed in the testing section of the contributing guideDescription
This PR adds tests to check how the Enter key works in the Scribe keyboard for Issue #440:
testEnterKeyBehavior
) inKeyboardTest
to verify thatKeyHandler
does not callcommitText
orsendKeyEvent
forKEYCODE_ENTER
inIDLE
state.testEnterKeyBehaviorInCommandBar
) inEnterKeyTest
to test thecommand_bar
EditText, assuming it clears after pressing Enter.EnterKeyTest
withActivityScenarioRule
.Related issue