Skip to content

Commit

Permalink
fix: adapt CreateAlertScreenTest and EditAlertScreenTest to account f…
Browse files Browse the repository at this point in the history
…or changes
  • Loading branch information
lazarinibruno committed Dec 18, 2024
1 parent 839f6af commit 54055b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class CreateAlertScreenTest {

private lateinit var navigationActions: NavigationActions
private lateinit var locationViewModel: LocationViewModel
private val mockAddress = MutableStateFlow("Some address")
private lateinit var gpsService: GPSServiceImpl
private val mockLocationFLow = MutableStateFlow(Location.DEFAULT_LOCATION)
private lateinit var authenticationViewModel: AuthenticationViewModel
Expand Down Expand Up @@ -162,6 +163,7 @@ class CreateAlertScreenTest {
`when`(userViewModel.user).thenReturn(userState)
`when`(authenticationViewModel.authUserData).thenReturn(authUserData)
`when`(navigationActions.currentRoute()).thenReturn(Route.ALERT)
`when`(locationViewModel.address).thenReturn(mockAddress)
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import org.robolectric.RobolectricTestRunner
class EditAlertScreenTest {
private lateinit var navigationActions: NavigationActions
private lateinit var locationViewModel: LocationViewModel
private val mockAddress = MutableStateFlow("Some address")
private lateinit var gpsService: GPSServiceImpl
private val mockLocationFLow = MutableStateFlow(Location.DEFAULT_LOCATION)
private lateinit var authenticationViewModel: AuthenticationViewModel
Expand Down Expand Up @@ -179,6 +180,8 @@ class EditAlertScreenTest {
MutableStateFlow(
listOf(LOCATION_SUGGESTION1, LOCATION_SUGGESTION2, LOCATION_SUGGESTION3)))
`when`(locationViewModel.query).thenReturn(MutableStateFlow(LOCATION_SUGGESTION1.name))

`when`(locationViewModel.address).thenReturn(mockAddress)
}

@Test
Expand Down

0 comments on commit 54055b1

Please sign in to comment.