Skip to content

Commit

Permalink
Added a test
Browse files Browse the repository at this point in the history
  • Loading branch information
grzesiek2010 committed Jul 1, 2024
1 parent 1dbe8ad commit e06589f
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,30 @@ class OfflineMapLayersPickerTest {
)
}

@Test
fun `the confirmation dialog is dismissed o activity recreation`() {
val scenario = launchFragment()

uris.add(Uri.parse("blah"))
Interactions.clickOn(withText(string.add_layer))

scenario.onFragment {
assertThat(
it.childFragmentManager.findFragmentByTag(OfflineMapLayersImporter::class.java.name),
instanceOf(OfflineMapLayersImporter::class.java)
)
}

scenario.recreate()

scenario.onFragment {
assertThat(
it.childFragmentManager.findFragmentByTag(OfflineMapLayersImporter::class.java.name),
equalTo(null)
)
}
}

private fun launchFragment(): FragmentScenario<OfflineMapLayersPicker> {
return fragmentScenarioLauncherRule.launchInContainer(OfflineMapLayersPicker::class.java)
}
Expand Down

0 comments on commit e06589f

Please sign in to comment.