oppia-android
oppia-android copied to clipboard
Add tests for FractionInputInteractionView
FractionInputInteractionView should have dedicated tests to verify that it behaves correctly as an interaction. Today, it's tested through InputInteractionViewTestActivity, but these tests ought to be moved to a dedicated test suite for fraction input, and other fraction-specific tests should be added.
@BenHenning Hey can I work on this? And also please do suggest which PR i should consider as reference to solve this issue.
Sure @bhaktideshmukh. For reference, you can look at InputInteractionViewTestActivity to see how we currently set up the fraction tests, though that suite isn't a good example of well-written tests themselves. For those, I suggest looking at the few tests in StateFragmentTest and StateFragmentLocalTest that verify fractions functionality (though a dedicated FractionInputInteractionViewTest should test all aspects of the fraction input interaction). I suggest writing an initial test suite and then following up with a draft PR where we can provide additional suggestions.
Note also that #2173 adds a new MathExpressionInteractionsViewTest that can probably serve as a good reference for future interaction test suites (I haven't looked at your PR yet @bhaktideshmukh it may be worth looking at MathExpressionInteractionsViewTest and seeing if anything from that test suite is worth basing changes to the new FractionInputInteractionViewTest).
The issue is reopened because of the following unresolved TODOs: https://github.com/oppia/oppia-android/blob/6723268c87de074b264022eac0e2dbad5db55d58/app/src/main/java/org/oppia/android/app/customview/interaction/FractionInputInteractionView.kt#L23
@masclot, please create a follow up PR to remove this leftover TODO and close the issue.