mirror of
https://github.com/bitwarden/android.git
synced 2026-05-31 01:22:39 -05:00
Ensure FAB is hidden for some Vault Screen states (#401)
This commit is contained in:
@@ -283,6 +283,25 @@ class VaultScreenTest : BaseComposeTest() {
|
||||
verify { viewModel.trySendAction(VaultAction.ExitConfirmationClick) }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `floating action button should be shown or hidden according to the state`() {
|
||||
val fabDescription = "Add item"
|
||||
|
||||
mutableStateFlow.update { it.copy(viewState = VaultState.ViewState.Loading) }
|
||||
composeTestRule.onNodeWithContentDescription(fabDescription).assertDoesNotExist()
|
||||
|
||||
mutableStateFlow.update {
|
||||
it.copy(viewState = VaultState.ViewState.Error("Error".asText()))
|
||||
}
|
||||
composeTestRule.onNodeWithContentDescription(fabDescription).assertDoesNotExist()
|
||||
|
||||
mutableStateFlow.update { it.copy(viewState = VaultState.ViewState.NoItems) }
|
||||
composeTestRule.onNodeWithContentDescription(fabDescription).assertIsDisplayed()
|
||||
|
||||
mutableStateFlow.update { it.copy(viewState = DEFAULT_CONTENT_VIEW_STATE) }
|
||||
composeTestRule.onNodeWithContentDescription(fabDescription).assertIsDisplayed()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `error dialog should be shown or hidden according to the state`() {
|
||||
val errorTitle = "Error title"
|
||||
|
||||
Reference in New Issue
Block a user