-
Notifications
You must be signed in to change notification settings - Fork 842
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PM-13842: Hide ownership when the user has no organizations
- Loading branch information
1 parent
fab0187
commit 0bb5a48
Showing
9 changed files
with
38 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2361,6 +2361,31 @@ class VaultAddEditScreenTest : BaseComposeTest() { | |
} | ||
} | ||
|
||
@Test | ||
fun `ownership section should not be displayed when no organizations present`() { | ||
updateStateWithOwners() | ||
|
||
composeTestRule | ||
.onNodeWithTextAfterScroll("[email protected]") | ||
.assertExists() | ||
|
||
updateStateWithOwners( | ||
selectedOwnerId = "mockOwnerId-1", | ||
availableOwners = listOf( | ||
VaultAddEditState.Owner( | ||
id = "mockOwnerId-1", | ||
name = "[email protected]", | ||
collections = emptyList(), | ||
), | ||
), | ||
hasOrganizations = false, | ||
) | ||
|
||
composeTestRule | ||
.onNodeWithText("[email protected]") | ||
.assertDoesNotExist() | ||
} | ||
|
||
@Test | ||
fun `Collection list should display according to state`() { | ||
updateStateWithOwners(selectedOwnerId = "mockOwnerId-2") | ||
|
@@ -3482,12 +3507,14 @@ class VaultAddEditScreenTest : BaseComposeTest() { | |
private fun updateStateWithOwners( | ||
selectedOwnerId: String? = null, | ||
availableOwners: List<VaultAddEditState.Owner> = DEFAULT_OWNERS, | ||
hasOrganizations: Boolean = true, | ||
) { | ||
mutableStateFlow.update { currentState -> | ||
updateCommonContent(currentState) { | ||
copy( | ||
selectedOwnerId = selectedOwnerId, | ||
availableOwners = availableOwners, | ||
hasOrganizations = hasOrganizations, | ||
) | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters