Skip to content

Commit

Permalink
test(friend): Fix test ParticipantListScreen
Browse files Browse the repository at this point in the history
Fix ParticipantListScreen test due to merge conflicts.
  • Loading branch information
RemIsMyWaifuu committed Dec 11, 2024
1 parent a2aaa4d commit 52efc4b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,8 @@ class ParticipantListScreenTest {
.`when`(profileRepository)
.getFsUidByEmail(any(), any(), any())
doAnswer { "abcdefghijklmnopqrst" }.`when`(notificationRepository).getNewUid()
doNothing().`when`(travelRepository).updateTravel(any(), any(), anyOrNull(), any(), any())
doNothing().`when`(travelRepository).updateTravel(any(), any(), anyOrNull(), any(), any(),
anyOrNull())
doThrow(RuntimeException("Impossible Exception"))
.`when`(notificationRepository)
.addNotification(anyOrNull())
Expand All @@ -710,7 +711,7 @@ class ParticipantListScreenTest {
listTravelViewModel.selectTravel(travelContainer)
composeTestRule.setContent {
ParticipantListScreen(
listTravelViewModel, navigationActions, notificationViewModel, profileModelView)
listTravelViewModel, navigationActions, notificationViewModel, profileModelView, eventViewModel)
}
composeTestRule.onNodeWithTag("addUserFab").performClick()
composeTestRule.onNodeWithTag("addViaFriendListButton").performClick()
Expand Down Expand Up @@ -743,7 +744,7 @@ class ParticipantListScreenTest {

composeTestRule.setContent {
ParticipantListScreen(
listTravelViewModel, navigationActions, notificationViewModel, profileModelView)
listTravelViewModel, navigationActions, notificationViewModel, profileModelView, eventViewModel)
}
composeTestRule.onNodeWithTag("addUserFab").performClick()
composeTestRule.onNodeWithTag("addViaFriendListButton").performClick()
Expand All @@ -769,7 +770,7 @@ class ParticipantListScreenTest {
.`when`(profileRepository)
.getFsUidByEmail(any(), any(), any())
doAnswer { "abcdefghijklmnopqrst" }.`when`(notificationRepository).getNewUid()
doNothing().`when`(travelRepository).updateTravel(any(), any(), anyOrNull(), any(), any())
doNothing().`when`(travelRepository).updateTravel(any(), any(), anyOrNull(), any(), any(), anyOrNull())
composeTestRule.onNodeWithTag("friendCard").assertIsDisplayed()
composeTestRule.onNodeWithTag("friendCard").assertTextContains("[email protected]")
composeTestRule.onNodeWithTag("friendCard").performClick()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ fun ParticipantListScreen(
listTravelViewModel.updateTravel(
updatedContainer,
TravelRepository.UpdateMode.REMOVE_PARTICIPANT,
participant.key)
participant.key, eventViewModel.getNewDocumentReference())
listTravelViewModel.selectTravel(updatedContainer)
listTravelViewModel.fetchAllParticipantsInfo()
setExpanded(false)
Expand Down

0 comments on commit 52efc4b

Please sign in to comment.