-
Notifications
You must be signed in to change notification settings - Fork 517
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
Add tests for TextViewBindingAdapters #3846
Comments
@BenHenning I'd Like to work upon it. |
@rishidyno Unassigning you from this issue because of inactivity, please re-assign yourself if you are currently working on this. |
@rt4914 @BenHenning @anandwana001 do I need to create a layout file for as for now, I have created a layout file for the same with a textview. Also as I don't have much experience in writing tests. Could you please give me a few examples for writing tests for binding adpters and explain them to me. Also, are there any prerequisites like learning something new in particular for this PR, please let me know and suggest some resources for the same? Thanks. |
@rishidyno you will need to create a test activity & layout (so that you have an easy-to-access TextView to test the adapters). In terms of how they work, I suggest looking at https://github.com/oppia/oppia-android/blob/develop/app/src/sharedTest/java/org/oppia/android/app/databinding/MarginBindingAdaptersTest.kt or other tests from that databinding package. Generally, the way we test binding adapters is by calling them directly to ensure that whatever they're supposed do/change actually happens. In terms of actually writing tests, I suggest reading over https://github.com/oppia/oppia-android/wiki/Oppia-Android-Testing#learning-how-to-write-good-tests including the corresponding presentation, if you haven't already. |
* first commit * nitfix * test added * test added * test file exemption * format * format * added textviewbindingadapters in binding adapters in app bazel file * removed * commit * fixed tests * fixed tests * fixed tests * test * test * test * test * test * test * code format * added label * final * few fixes * nitfix * nitfix * added another test case * update * Update AndroidManifest.xml * added test cases for profile last visited * added textviewbindingadapterstestactivity to accessibility_label_exemptions.textproto * added textviewbindingadapterstestactivity to accessibility_label_exemptions.textproto * added textviewbindingadapterstestactivity to accessibility_label_exemptions.textproto * format * added all test cases for profile last visited * added more test cases for profile last visited * give more descriptive test names * added recently srring resource * nit-fix * nit-fix * nit-fix
TextViewBindingAdapters today doesn't have any tests for it, and ought to since it may not be obvious to track down future regressions that may occur in this file. These tests also ought to specifically test the binding adapters in their normal context (i.e. used through databinding with a test layout).
This also tracks adding new testing coverage after #3795 is merged since https://github.com/oppia/oppia-android/blob/baf7fd23affbf7dc27192a24fbb881e10519d2e7/utility/src/test/java/org/oppia/android/util/system/OppiaDateTimeFormatterTest.kt is being removed & its behaviors are now part of TextVIewBindingAdapters directly (so the same behaviors from that test suite should be added to the test suite for TextViewBindingAdapters).
The text was updated successfully, but these errors were encountered: