Skip to content

Commit

Permalink
Merge pull request #5877 from grzesiek2010/COLLECT-5856
Browse files Browse the repository at this point in the history
Fixed setting up the sort menu
  • Loading branch information
seadowg authored Jan 8, 2024
2 parents 7cbc0b3 + f7d4390 commit 431b1b1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import org.junit.Test;
import org.junit.rules.RuleChain;
import org.junit.runner.RunWith;
import org.odk.collect.android.R;
import org.odk.collect.android.support.pages.DeleteSavedFormPage;
import org.odk.collect.android.support.rules.CollectTestRule;
import org.odk.collect.android.support.rules.TestRuleChain;
import org.odk.collect.android.support.pages.MainMenuPage;
Expand Down Expand Up @@ -36,4 +38,18 @@ public void deletingAForm_removesFormFromFinalizedForms() {
.pressBack(new MainMenuPage())
.assertNumberOfFinalizedForms(0);
}

@Test
public void accessingSortMenuInDeleteSavedInstancesShouldNotCrashTheAppAfterRotatingTheDevice() {
rule.startAtMainMenu()
.copyForm("one-question.xml")
.startBlankForm("One Question")
.answerQuestion("what is your age", "30")
.swipeToEndScreen()
.clickFinalize()
.clickDeleteSavedForm()
.rotateToLandscape(new DeleteSavedFormPage())
.clickOnId(R.id.menu_sort)
.assertText(org.odk.collect.strings.R.string.sort_by);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
new FormListSortingBottomSheetDialog(
requireContext(),
sortingOptions,
selectedSortingOrder,
getSelectedSortingOrder(),
selectedOption -> {
saveSelectedSortingOrder(selectedOption);
updateAdapter();
Expand Down

0 comments on commit 431b1b1

Please sign in to comment.