diff --git a/app/src/test/java/com/android/periodpals/ui/alert/CreateAlertScreenTest.kt b/app/src/test/java/com/android/periodpals/ui/alert/CreateAlertScreenTest.kt index fd85cb8b..4eae0138 100644 --- a/app/src/test/java/com/android/periodpals/ui/alert/CreateAlertScreenTest.kt +++ b/app/src/test/java/com/android/periodpals/ui/alert/CreateAlertScreenTest.kt @@ -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 @@ -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 diff --git a/app/src/test/java/com/android/periodpals/ui/alert/EditAlertScreenTest.kt b/app/src/test/java/com/android/periodpals/ui/alert/EditAlertScreenTest.kt index 3247d282..a77a6737 100644 --- a/app/src/test/java/com/android/periodpals/ui/alert/EditAlertScreenTest.kt +++ b/app/src/test/java/com/android/periodpals/ui/alert/EditAlertScreenTest.kt @@ -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 @@ -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