-
Notifications
You must be signed in to change notification settings - Fork 529
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
Fix #3169: ItemSelectionInteraction text change on selection #3814
Fix #3169: ItemSelectionInteraction text change on selection #3814
Conversation
@rt4914 PTAL |
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.
@darkmat13r Thanks a lot. Just need to add one more test case otherwise LGTM
app/src/sharedTest/java/org/oppia/android/app/player/state/StateFragmentTest.kt
Show resolved
Hide resolved
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.
LGTM, thanks.
@BenHenning Any idea why bazel tests are failing?
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 @darkmat13r! Just had a few comments--PTAL.
} | ||
|
||
@Test | ||
fun testStateFragment_interactions_land_singleItemSelected_selectionTextIsNotDisplayed() { |
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.
Can you add tests to demonstrate that the selection text retains its showing/not showing behavior after performing a rotation & activity recreation?
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.
@BenHenning Yes. I will add the test case.
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.
@BenHenning I have remove the landscape test cases as these doesn't make sense because currently when you select some answers and rotate the screen all values gets lost. So right now we can't add those test cases related to orientation change or activity recreation.
Follow are the removed test cases for landscape orientation:
testStateFragment_interactions_land_noItemSelected_selectionTextIsDisplayed
testStateFragment_interactions_land_singleItemSelected_selectionTextIsNotDisplayed
testStateFragment_interactions_land_multipleItemSelected_selectionTextIsNotDisplayed
testStateFragment_interactions_changeConfiguration_selectUnselectCheckbox_selectionTextIsDisplayedCorrectly
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.
@BenHenning PTAL
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.
Ah, yes that's related to #1594. Fair point--I think omitting these tests are fine. Instead, can you add a TODO, such as:
// TODO(#1594): Add tests to ensure the selection text is properly showing/not showing after a configuration change.
app/src/sharedTest/java/org/oppia/android/app/player/state/StateFragmentTest.kt
Outdated
Show resolved
Hide resolved
.../main/java/org/oppia/android/app/player/state/itemviewmodel/SelectionInteractionViewModel.kt
Show resolved
Hide resolved
@@ -46,7 +46,7 @@ | |||
android:textColor="@color/oppiaPrimaryText" | |||
android:textSize="14sp" | |||
android:textStyle="italic" | |||
android:visibility="@{viewModel.getSelectionItemInputType() == SelectionItemInputType.RADIO_BUTTONS ? View.GONE : View. VISIBLE}" /> | |||
android:visibility="@{viewModel.getSelectionItemInputType() == SelectionItemInputType.RADIO_BUTTONS || viewModel.selectedItemsCount > 0 ? View.GONE : View. VISIBLE}" /> |
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.
Given the OR here, do we already have tests verifying that the text is always showing for radio buttons for both unselected & selected states to contrast with the checkbox behavior?
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.
@BenHenning No, I will add them.
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.
@BenHenning For the radio buttons the text will always be hidden. I am not sure we need tests for this.
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.
@BenHenning I have added test case for the radio buttons.
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.
@BenHenning PTAL
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 think you also need a test for state 2 (which is MultipleChoiceInput) to ensure that the text view is correctly arranged for that interaction, as well.
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.
@BenHenning state 2 is Fraction input option. State 3 and state 4 are multiple choice input. I have already added the test case for state 4.
@Test
fun testStateFragment_interactions_radioItemSelection_selectionTextIsNotDisplayed() {
launchForExploration(TEST_EXPLORATION_ID_2, shouldSavePartialProgress = false).use {
startPlayingExploration()
playThroughPrototypeState1()
playThroughPrototypeState2()
playThroughPrototypeState3()
// Verify that the user is now on the fourth state.
verifyViewTypeIsPresent(SELECTION_INTERACTION)
onView(withId(R.id.selection_interaction_textview)).check(matches(not(isDisplayed())))
}
}
//Added these additional test cases
testStateFragment_interactions_singleRadioItemSelected_selectionTextIsNotDisplayed
testStateFragment_interactions_multipleRadioItemSelected_selectionTextIsNotDisplayed
testStateFragment_interactions_correctRadioItemSelected_selectionTextIsNotDisplayed
…nteraction_text_change
Hi @darkmat13r, 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. |
…eraction_text_change
Hi @darkmat13r, 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 @darkmat13r, 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 @darkmat13r, 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. |
@darkmat13r Can you please reply to all the open-comments, that way based on reply Ben can decide if that comment can be resolved or not. Thanks |
@BenHenning @rt4914 All the comments are resolved but I am not able to run the test cases. Some test cases are failing so I need to fix them. |
FYI I'm listed as a codeowner for this PR & I'll be unavailable to perform code reviews over the next 2 weeks--thanks for your patience. |
@darkmat13r why aren't you able to run the test cases? It'd be really helpful to get more context. Please see https://github.com/oppia/oppia-android/wiki/Frequent-Errors-and-Solutions#facing-error-while-debugging-code which includes tips on debugging, and instructions for creating a debug doc that you can share with folks to make it easier for them to help you. |
@BenHenning Not able to run the test cases on android studio artic fox version. The solution i mention to work on Java Idea community version also not working . I will provide more details on the error. |
Hi @darkmat13r, 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. |
Explanation
Fix #3169 : ItemSelectionInteraction text change on selection
Essential Checklist
For UI-specific PRs only
If your PR includes UI-related changes, then:
Before
After