Skip to content

Commit

Permalink
Closes mozilla-mobile#25954: fix history UI test
Browse files Browse the repository at this point in the history
  • Loading branch information
mike a committed Jul 10, 2022
1 parent ba13f1f commit 425c3a4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ private fun assertPageUrl(expectedUrl: Uri) = pageUrl()
.check(matches(withText(Matchers.containsString(expectedUrl.toString()))))

private fun assertDeleteConfirmationMessage() =
onView(withText("This will delete all of your browsing data."))
onView(withText("Removes history (including history synced from other devices), cookies and other browsing data."))
.inRoot(isDialog())
.check(matches(isDisplayed()))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,8 @@ class HistoryFragment : LibraryPageFragment<History>(), UserInteractionHandler {
DeleteConfirmationDialogFragment(
historyView = historyView,
historyStore = historyStore,
browserStore = requireComponents.core.store
browserStore = requireComponents.core.store,
parentView = requireView()
).show(childFragmentManager, null)
}

Expand Down Expand Up @@ -366,7 +367,8 @@ class HistoryFragment : LibraryPageFragment<History>(), UserInteractionHandler {
internal class DeleteConfirmationDialogFragment(
private val historyView: HistoryView,
private val historyStore: HistoryFragmentStore,
private val browserStore: BrowserStore
private val browserStore: BrowserStore,
private val parentView: View
) : DialogFragment() {
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog =
AlertDialog.Builder(requireContext()).apply {
Expand All @@ -392,7 +394,7 @@ class HistoryFragment : LibraryPageFragment<History>(), UserInteractionHandler {
historyView.historyAdapter.refresh()
historyStore.dispatch(HistoryFragmentAction.ExitDeletionMode)
showSnackBar(
requireView(),
parentView,
getString(R.string.preferences_delete_browsing_data_snackbar)
)
}
Expand All @@ -414,7 +416,7 @@ class HistoryFragment : LibraryPageFragment<History>(), UserInteractionHandler {
historyView.historyAdapter.refresh()
historyStore.dispatch(HistoryFragmentAction.ExitDeletionMode)
showSnackBar(
requireView(),
parentView,
getString(R.string.preferences_delete_browsing_data_snackbar)
)
}
Expand Down

0 comments on commit 425c3a4

Please sign in to comment.