diff --git a/app/src/androidTest/java/com/android/unio/end2end/AssociationProfileE2ETest.kt b/app/src/androidTest/java/com/android/unio/end2end/AssociationProfileE2ETest.kt index 78aeb138..6dfe05be 100644 --- a/app/src/androidTest/java/com/android/unio/end2end/AssociationProfileE2ETest.kt +++ b/app/src/androidTest/java/com/android/unio/end2end/AssociationProfileE2ETest.kt @@ -219,31 +219,32 @@ class AssociationProfileE2ETest : EndToEndTest() { } composeTestRule.onNodeWithTag(AssociationProfileTestTags.ACTIONS_PAGE).performClick() - composeTestRule.onNodeWithTag(AssociationProfileActionsTestTags.EDIT_ROLE + "Test Role").performScrollTo() - composeTestRule.onNodeWithTag(AssociationProfileActionsTestTags.EDIT_ROLE + "Test Role").performClick() + composeTestRule + .onNodeWithTag(AssociationProfileActionsTestTags.EDIT_ROLE + "Test Role") + .performScrollTo() + composeTestRule + .onNodeWithTag(AssociationProfileActionsTestTags.EDIT_ROLE + "Test Role") + .performClick() composeTestRule.waitUntil(40000) { composeTestRule - .onNodeWithTag(AssociationProfileActionsTestTags.CREATE_ROLE_DISPLAY_NAME) - .isDisplayed() + .onNodeWithTag(AssociationProfileActionsTestTags.CREATE_ROLE_DISPLAY_NAME) + .isDisplayed() } // Enter role display name val roleDisplayName = "Edited Test Role" composeTestRule - .onNodeWithTag(AssociationProfileActionsTestTags.CREATE_ROLE_DISPLAY_NAME) - .performTextInput("Edited ") + .onNodeWithTag(AssociationProfileActionsTestTags.CREATE_ROLE_DISPLAY_NAME) + .performTextInput("Edited ") Espresso.closeSoftKeyboard() // Confirm the role creation composeTestRule - .onNodeWithText( - composeTestRule.activity.getString( - R.string.association_profile_save_role_dialog_save)) - .performClick() - - + .onNodeWithText( + composeTestRule.activity.getString(R.string.association_profile_save_role_dialog_save)) + .performClick() // Verify the role was created composeTestRule.waitUntil(10000) { @@ -294,10 +295,12 @@ class AssociationProfileE2ETest : EndToEndTest() { } composeTestRule.onNodeWithTag(AssociationProfileTestTags.ACTIONS_PAGE).performClick() - composeTestRule.onNodeWithTag(AssociationProfileActionsTestTags.DELETE_ROLE + "Edited Test Role").performScrollTo() - composeTestRule.onNodeWithTag(AssociationProfileActionsTestTags.DELETE_ROLE + "Edited Test Role").performClick() - - + composeTestRule + .onNodeWithTag(AssociationProfileActionsTestTags.DELETE_ROLE + "Edited Test Role") + .performScrollTo() + composeTestRule + .onNodeWithTag(AssociationProfileActionsTestTags.DELETE_ROLE + "Edited Test Role") + .performClick() composeTestRule.waitUntil(50000) { composeTestRule.onNodeWithTag(AssociationProfileTestTags.OVERVIEW_PAGE).isDisplayed() diff --git a/app/src/main/java/com/android/unio/ui/association/AssociationProfile.kt b/app/src/main/java/com/android/unio/ui/association/AssociationProfile.kt index a85a3be4..8f09d0e6 100644 --- a/app/src/main/java/com/android/unio/ui/association/AssociationProfile.kt +++ b/app/src/main/java/com/android/unio/ui/association/AssociationProfile.kt @@ -106,7 +106,6 @@ import com.android.unio.ui.theme.AppTypography import com.android.unio.ui.utils.ToastUtils import com.github.skydoves.colorpicker.compose.HsvColorPicker import com.github.skydoves.colorpicker.compose.rememberColorPickerController -import kotlinx.coroutines.launch /** * Composable element that contain the association profile screen. It display the association. @@ -691,10 +690,7 @@ private fun AssociationActionsMembers( } if (members != null) { - SearchPagerSection( - items = members, - cardContent = { cardContent(it) }, - pagerState = pagerState) + SearchPagerSection(items = members, cardContent = { cardContent(it) }, pagerState = pagerState) association?.let { RolesManagementScreen(it.roles, associationViewModel = associationViewModel) @@ -778,14 +774,22 @@ fun RoleCard(role: Role, associationViewModel: AssociationViewModel) { imageVector = Icons.Default.Edit, contentDescription = context.getString(R.string.association_profile_role_card_edit_role), - modifier = Modifier.size(24.dp).clickable { showEditDialog = true }.padding(4.dp).testTag(AssociationProfileActionsTestTags.EDIT_ROLE + role.displayName)) + modifier = + Modifier.size(24.dp) + .clickable { showEditDialog = true } + .padding(4.dp) + .testTag(AssociationProfileActionsTestTags.EDIT_ROLE + role.displayName)) Icon( imageVector = Icons.Default.Delete, contentDescription = context.getString(R.string.association_profile_role_card_delete_role), modifier = - Modifier.size(24.dp).clickable { showDeleteDialog = true }.padding(4.dp).testTag(AssociationProfileActionsTestTags.DELETE_ROLE + role.displayName)) + Modifier.size(24.dp) + .clickable { showDeleteDialog = true } + .padding(4.dp) + .testTag( + AssociationProfileActionsTestTags.DELETE_ROLE + role.displayName)) } } diff --git a/app/src/main/java/com/android/unio/ui/components/SearchBar.kt b/app/src/main/java/com/android/unio/ui/components/SearchBar.kt index 89429032..e194a9a7 100644 --- a/app/src/main/java/com/android/unio/ui/components/SearchBar.kt +++ b/app/src/main/java/com/android/unio/ui/components/SearchBar.kt @@ -30,8 +30,6 @@ import androidx.compose.ui.platform.testTag import androidx.compose.ui.unit.dp import com.android.unio.R import com.android.unio.model.association.Association -import com.android.unio.model.association.Member -import com.android.unio.model.event.Event import com.android.unio.model.search.SearchViewModel import com.android.unio.model.strings.test_tags.explore.ExploreContentTestTags import com.android.unio.ui.theme.AppTypography @@ -237,4 +235,4 @@ fun AssociationSearchBar( } } } -} \ No newline at end of file +}