-
Notifications
You must be signed in to change notification settings - Fork 571
Fix #5818: Add comprehensive tests for EditTextInputAction append/rep… #5944
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
Conversation
…d/replace functionality
|
PTAL @theayushyadav11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @shrimpnaur, this is nicely done. Just a few nits regarding test namings (guide) and arrangement.
testing/src/test/java/org/oppia/android/testing/espresso/EditTextInputActionTest.kt
Outdated
Show resolved
Hide resolved
testing/src/test/java/org/oppia/android/testing/espresso/EditTextInputActionTest.kt
Outdated
Show resolved
Hide resolved
testing/src/test/java/org/oppia/android/testing/espresso/EditTextInputActionTest.kt
Outdated
Show resolved
Hide resolved
testing/src/test/java/org/oppia/android/testing/espresso/EditTextInputActionTest.kt
Outdated
Show resolved
Hide resolved
testing/src/test/java/org/oppia/android/testing/espresso/EditTextInputActionTest.kt
Outdated
Show resolved
Hide resolved
testing/src/test/java/org/oppia/android/testing/espresso/EditTextInputActionTest.kt
Outdated
Show resolved
Hide resolved
testing/src/test/java/org/oppia/android/testing/espresso/EditTextInputActionTest.kt
Outdated
Show resolved
Hide resolved
testing/src/test/java/org/oppia/android/testing/espresso/EditTextInputActionTest.kt
Outdated
Show resolved
Hide resolved
testing/src/test/java/org/oppia/android/testing/espresso/EditTextInputActionTest.kt
Outdated
Show resolved
Hide resolved
testing/src/test/java/org/oppia/android/testing/espresso/EditTextInputActionTest.kt
Show resolved
Hide resolved
|
Hi @shrimpnaur, just a small request, please avoid resolving comments that were not opened by you. Instead, you can respond with "Done," "Updated," or share any thoughts you have. The reviewer will take care of resolving the comments. |
|
Understood and resolved the comments. PTAL @theayushyadav11 |
|
Unassigning @shrimpnaur since a re-review was requested. @shrimpnaur, please make sure you have addressed all review comments. Thanks! |
|
@theayushyadav11 Hey there, just wanted to check up on this. Does everything work as intended? |
|
Hi @shrimpnaur, apologies for the delay. We will give you a full review tomorrow. |
|
Thanks @shrimpnaur for addressing the comments. This LGTM. |
|
Unassigning @theayushyadav11 since they have already approved the PR. |
|
Assigning @BenHenning for code owner reviews. Thanks! |
Coverage ReportResultsNumber of files assessed: 1 Exempted coverageFiles exempted from coverage
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @shrimpnaur for this PR. I am handing this over to @BenHenning to help with the technical decisions.
| * in Robolectric environments. | ||
| */ | ||
| @RunWith(AndroidJUnit4::class) | ||
| @Config(application = EditTextInputActionTest.TestApplication::class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests are good if the goal is lightweight unit tests, but the common pattern in the repo is to use instrumented unit tests/ semi integration tests like in TextInputActionTest.kt.
I would like @BenHenning to weigh in here, whether we should go with this approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. The variety of tests is really good, but we ought to ensure that the action actually integrates with Espresso correctly (which means using it as an Espresso action rather than directly calling it). TextInputActionTest is a really good basis for reference on how to do that since it's also validating a custom Espresso action.
|
Thank you for the feedback. I understand that these are architectural decisions that need your input. Could you please let me know if I should wait for the technical decisions before making any changes? I'm happy to adjust the implementation once the preferred approach is determined. |
|
Hi @shrimpnaur, I understand that you are blocked on this PR. It would be great to work on a new issue in the meantime, to parallelize your efforts. We have updated our list of starter issues, so I hope you find some interesting stuff to work on! |
|
@adhiamboperes Yeah sure. 👍 |
|
Hi @shrimpnaur, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @shrimpnaur! Apologies for the delay--I was sick and it took a number of days to catch up on things. I've followed up to @adhiamboperes's comments--PTAL.
| * in Robolectric environments. | ||
| */ | ||
| @RunWith(AndroidJUnit4::class) | ||
| @Config(application = EditTextInputActionTest.TestApplication::class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. The variety of tests is really good, but we ought to ensure that the action actually integrates with Espresso correctly (which means using it as an Espresso action rather than directly calling it). TextInputActionTest is a really good basis for reference on how to do that since it's also validating a custom Espresso action.
|
Hi @BenHenning , I'll make these changes and update the PR shortly. |
|
Hi @shrimpnaur, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue. |
|
Hi @shrimpnaur, do you need support on this PR? |
|
Hey @adhiamboperes
Could you point me to the best approach for this? Thanks! |
|
Hi @shrimpnaur, please create a new test activity as it is fairly simple. Also make sure you add the activity to the |
|
Hi @shrimpnaur, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue. |
This PR addresses part of #5818 by adding comprehensive tests for
EditTextInputActionto verify correct append and replace text behavior in Robolectric environments.What This PR Does
EditTextInputActionTest.ktwith comprehensive test coverage forEditTextInputActionappendText()correctly appends to existing text (e.g., "123" + "45" = "12345")replaceText()correctly replaces existing text (e.g., "123" → "45")Testing
isAppend=trueandisAppend=falsecode paths in theupdateText()methodThe core bug fix was already implemented in PR #5617. This PR adds the missing test coverage as specified in issue #5818.
Fixes part of #5818
Essential Checklist