diff --git a/app/src/androidTest/java/com/android/unio/components/authentication/AccountDetailsTest.kt b/app/src/androidTest/java/com/android/unio/components/authentication/AccountDetailsTest.kt index 4cc9abe49..e6a735bbc 100644 --- a/app/src/androidTest/java/com/android/unio/components/authentication/AccountDetailsTest.kt +++ b/app/src/androidTest/java/com/android/unio/components/authentication/AccountDetailsTest.kt @@ -6,6 +6,7 @@ import androidx.compose.ui.test.assertIsNotDisplayed import androidx.compose.ui.test.assertTextContains import androidx.compose.ui.test.assertTextEquals import androidx.compose.ui.test.hasText +import androidx.compose.ui.test.isDisplayed import androidx.compose.ui.test.junit4.createComposeRule import androidx.compose.ui.test.onNodeWithTag import androidx.compose.ui.test.performClick @@ -199,10 +200,16 @@ class AccountDetailsTest : TearDown() { .onNodeWithTag(SocialsOverlayTestTags.SAVE_BUTTON) .performScrollTo() .performClick() + Thread.sleep(20000) composeTestRule .onNodeWithTag(AccountDetailsTestTags.SOCIALS_CHIP + "Facebook") .performScrollTo() .assertIsDisplayed() + composeTestRule.waitUntil(10000) { + composeTestRule + .onNodeWithTag(AccountDetailsTestTags.SOCIALS_CHIP + "Instagram", useUnmergedTree = true) + .isDisplayed() + } composeTestRule .onNodeWithTag(AccountDetailsTestTags.SOCIALS_CHIP + "Instagram", true) .performScrollTo() diff --git a/app/src/main/java/com/android/unio/model/association/AssociationViewModel.kt b/app/src/main/java/com/android/unio/model/association/AssociationViewModel.kt index a76dfeb99..714f39bf4 100644 --- a/app/src/main/java/com/android/unio/model/association/AssociationViewModel.kt +++ b/app/src/main/java/com/android/unio/model/association/AssociationViewModel.kt @@ -97,7 +97,7 @@ constructor( _selectedAssociation.value = updatedAssociation } - _associationsByCategory.value = _associations.value.groupBy { it.category } + _associationsByCategory.value = _associations.value.groupBy { it.category } } else { Log.e("AssociationViewModel", "Association with ID $associationId not found.") } @@ -134,7 +134,7 @@ constructor( _selectedAssociation.value = updatedAssociation } - _associationsByCategory.value = _associations.value.groupBy { it.category } + _associationsByCategory.value = _associations.value.groupBy { it.category } } else { Log.e("AssociationViewModel", "Association with ID $associationId not found.") } @@ -169,7 +169,7 @@ constructor( _selectedAssociation.value = updatedAssociation } - _associationsByCategory.value = _associations.value.groupBy { it.category } + _associationsByCategory.value = _associations.value.groupBy { it.category } } else { Log.e("AssociationViewModel", "Association with ID $associationId not found.") } @@ -392,8 +392,6 @@ constructor( } } - - /** * Removes the specified role from the selected association. If the role does not exist, an error * is triggered. After removing the role, the association is saved and the local state is updated.