Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.x8bit.bitwarden.ui.auth.feature.loginwithdevice

import androidx.compose.ui.test.assert
import androidx.compose.ui.test.assertCountEquals
import androidx.compose.ui.test.assertIsDisplayed
import androidx.compose.ui.test.hasAnyAncestor
import androidx.compose.ui.test.isDialog
Expand Down Expand Up @@ -117,14 +116,12 @@ class LoginWithDeviceScreenTest : BitwardenComposeTest() {
mutableStateFlow.update {
it.copy(viewState = LoginWithDeviceState.ViewState.Loading)
}
// There are 2 because of the pull-to-refresh
composeTestRule.onAllNodes(isProgressBar).assertCountEquals(2)
composeTestRule.onNode(isProgressBar).assertIsDisplayed()

mutableStateFlow.update {
it.copy(viewState = DEFAULT_STATE.viewState)
}
// Only pull-to-refresh remains
composeTestRule.onAllNodes(isProgressBar).assertCountEquals(1)
composeTestRule.onNode(isProgressBar).assertDoesNotExist()
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.x8bit.bitwarden.ui.platform.feature.search

import androidx.compose.ui.test.assert
import androidx.compose.ui.test.assertCountEquals
import androidx.compose.ui.test.assertIsDisplayed
import androidx.compose.ui.test.assertIsNotDisplayed
import androidx.compose.ui.test.filterToOne
Expand Down Expand Up @@ -181,15 +180,13 @@ class SearchScreenTest : BitwardenComposeTest() {
@Test
fun `progressbar should be displayed according to state`() {
mutableStateFlow.update { DEFAULT_STATE }
// There are 2 because of the pull-to-refresh
composeTestRule.onAllNodes(isProgressBar).assertCountEquals(2)
composeTestRule.onNode(isProgressBar).assertIsDisplayed()

mutableStateFlow.update {
it.copy(viewState = SearchState.ViewState.Empty(message = null))
}

// Only pull-to-refresh remains
composeTestRule.onAllNodes(isProgressBar).assertCountEquals(1)
composeTestRule.onNode(isProgressBar).assertDoesNotExist()
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.x8bit.bitwarden.ui.platform.feature.settings.flightrecorder.recordedlogs

import androidx.compose.ui.test.assertCountEquals
import androidx.compose.ui.test.assertIsDisplayed
import androidx.compose.ui.test.assertIsEnabled
import androidx.compose.ui.test.assertIsNotEnabled
Expand Down Expand Up @@ -103,8 +102,7 @@ class RecordedLogsScreenTest : BitwardenComposeTest() {
@Test
fun `UI should change based on ViewState`() {
mutableStateFlow.update { it.copy(viewState = RecordedLogsState.ViewState.Loading) }
// There are 2 because of the pull-to-refresh
composeTestRule.onAllNodes(isProgressBar).assertCountEquals(2)
composeTestRule.onNode(isProgressBar).assertIsDisplayed()

mutableStateFlow.update { it.copy(viewState = RecordedLogsState.ViewState.Empty) }
composeTestRule.onNodeWithText(text = "No logs recorded").assertIsDisplayed()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.x8bit.bitwarden.ui.tools.feature.send

import androidx.compose.ui.test.assert
import androidx.compose.ui.test.assertCountEquals
import androidx.compose.ui.test.assertIsDisplayed
import androidx.compose.ui.test.assertTextEquals
import androidx.compose.ui.test.filterToOne
Expand Down Expand Up @@ -306,26 +305,22 @@ class SendScreenTest : BitwardenComposeTest() {
mutableStateFlow.update {
it.copy(viewState = SendState.ViewState.Loading)
}
// There are 2 because of the pull-to-refresh
composeTestRule.onAllNodes(isProgressBar).assertCountEquals(2)
composeTestRule.onNode(isProgressBar).assertIsDisplayed()

mutableStateFlow.update {
it.copy(viewState = SendState.ViewState.Empty)
}
// Only pull-to-refresh remains
composeTestRule.onAllNodes(isProgressBar).assertCountEquals(1)
composeTestRule.onNode(isProgressBar).assertDoesNotExist()

mutableStateFlow.update {
it.copy(viewState = SendState.ViewState.Error("Fail".asText()))
}
// Only pull-to-refresh remains
composeTestRule.onAllNodes(isProgressBar).assertCountEquals(1)
composeTestRule.onNode(isProgressBar).assertDoesNotExist()

mutableStateFlow.update {
it.copy(viewState = DEFAULT_CONTENT_VIEW_STATE)
}
// Only pull-to-refresh remains
composeTestRule.onAllNodes(isProgressBar).assertCountEquals(1)
composeTestRule.onNode(isProgressBar).assertDoesNotExist()
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.x8bit.bitwarden.ui.tools.feature.send.addedit

import androidx.compose.ui.test.assert
import androidx.compose.ui.test.assertCountEquals
import androidx.compose.ui.test.assertIsDisplayed
import androidx.compose.ui.test.assertIsEnabled
import androidx.compose.ui.test.assertIsNotDisplayed
Expand Down Expand Up @@ -731,20 +730,17 @@ class AddEditSendScreenTest : BitwardenComposeTest() {
mutableStateFlow.update {
it.copy(viewState = AddEditSendState.ViewState.Loading)
}
// There are 2 because of the pull-to-refresh
composeTestRule.onAllNodes(isProgressBar).assertCountEquals(2)
composeTestRule.onNode(isProgressBar).assertIsDisplayed()

mutableStateFlow.update {
it.copy(viewState = AddEditSendState.ViewState.Error("Fail".asText()))
}
// Only pull-to-refresh remains
composeTestRule.onAllNodes(isProgressBar).assertCountEquals(1)
composeTestRule.onNode(isProgressBar).assertDoesNotExist()

mutableStateFlow.update {
it.copy(viewState = DEFAULT_VIEW_STATE)
}
// Only pull-to-refresh remains
composeTestRule.onAllNodes(isProgressBar).assertCountEquals(1)
composeTestRule.onNode(isProgressBar).assertDoesNotExist()
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.x8bit.bitwarden.ui.tools.feature.send.viewsend

import androidx.compose.ui.test.assert
import androidx.compose.ui.test.assertCountEquals
import androidx.compose.ui.test.assertIsDisplayed
import androidx.compose.ui.test.assertIsNotDisplayed
import androidx.compose.ui.test.hasAnyAncestor
Expand Down Expand Up @@ -171,12 +170,10 @@ class ViewSendScreenTest : BitwardenComposeTest() {
@Test
fun `progress bar should be displayed based on ViewState`() {
mutableStateFlow.update { it.copy(viewState = ViewSendState.ViewState.Loading) }
// There are 2 because of the pull-to-refresh
composeTestRule.onAllNodes(isProgressBar).assertCountEquals(2)
composeTestRule.onNode(isProgressBar).assertIsDisplayed()

mutableStateFlow.update { it.copy(viewState = DEFAULT_STATE.viewState) }
// Only pull-to-refresh remains
composeTestRule.onAllNodes(isProgressBar).assertCountEquals(1)
composeTestRule.onNode(isProgressBar).assertDoesNotExist()
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -618,14 +618,12 @@ class VaultAddEditScreenTest : BitwardenComposeTest() {
mutableStateFlow.update {
it.copy(viewState = VaultAddEditState.ViewState.Loading)
}
// There are 2 because of the pull-to-refresh
composeTestRule.onAllNodes(isProgressBar).assertCountEquals(2)
composeTestRule.onNode(isProgressBar).assertIsDisplayed()

mutableStateFlow.update {
it.copy(viewState = VaultAddEditState.ViewState.Error("Fail".asText()))
}
// Only pull-to-refresh remains
composeTestRule.onAllNodes(isProgressBar).assertCountEquals(1)
composeTestRule.onNode(isProgressBar).assertDoesNotExist()

mutableStateFlow.update {
it.copy(
Expand All @@ -636,8 +634,7 @@ class VaultAddEditScreenTest : BitwardenComposeTest() {
),
)
}
// Only pull-to-refresh remains
composeTestRule.onAllNodes(isProgressBar).assertCountEquals(1)
composeTestRule.onNode(isProgressBar).assertDoesNotExist()
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.x8bit.bitwarden.ui.vault.feature.attachments

import androidx.compose.ui.test.assert
import androidx.compose.ui.test.assertCountEquals
import androidx.compose.ui.test.assertIsDisplayed
import androidx.compose.ui.test.filterToOne
import androidx.compose.ui.test.hasAnyAncestor
Expand Down Expand Up @@ -92,20 +91,17 @@ class AttachmentsScreenTest : BitwardenComposeTest() {
@Test
fun `progressbar should be displayed according to state`() {
mutableStateFlow.update { it.copy(viewState = AttachmentsState.ViewState.Loading) }
// There are 2 because of the pull-to-refresh
composeTestRule.onAllNodes(isProgressBar).assertCountEquals(2)
composeTestRule.onNode(isProgressBar).assertIsDisplayed()

mutableStateFlow.update {
it.copy(viewState = AttachmentsState.ViewState.Error("Fail".asText()))
}
// Only pull-to-refresh remains
composeTestRule.onAllNodes(isProgressBar).assertCountEquals(1)
composeTestRule.onNode(isProgressBar).assertDoesNotExist()

mutableStateFlow.update {
it.copy(viewState = DEFAULT_CONTENT_WITHOUT_ATTACHMENTS)
}
// Only pull-to-refresh remains
composeTestRule.onAllNodes(isProgressBar).assertCountEquals(1)
composeTestRule.onNode(isProgressBar).assertDoesNotExist()
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2045,8 +2045,7 @@ class VaultItemScreenTest : BitwardenComposeTest() {
)
}

// Only pull-to-refresh remains
composeTestRule.onAllNodes(isProgressBar).assertCountEquals(1)
composeTestRule.onNode(isProgressBar).assertDoesNotExist()

composeTestRule
.onNodeWithText("Passkey")
Expand Down Expand Up @@ -2091,8 +2090,7 @@ class VaultItemScreenTest : BitwardenComposeTest() {
)
}

// Only pull-to-refresh remains
composeTestRule.onAllNodes(isProgressBar).assertCountEquals(1)
composeTestRule.onNode(isProgressBar).assertDoesNotExist()

composeTestRule
.onNodeWithContentDescription("Copy TOTP")
Expand All @@ -2113,8 +2111,7 @@ class VaultItemScreenTest : BitwardenComposeTest() {
}

composeTestRule.onNodeWithTextAfterScroll("Authenticator key")
// There are 2 because of the pull-to-refresh
composeTestRule.onAllNodes(isProgressBar).assertCountEquals(2)
composeTestRule.onNode(isProgressBar).assertIsDisplayed()

composeTestRule
.onNodeWithContentDescription("Copy TOTP")
Expand All @@ -2130,8 +2127,7 @@ class VaultItemScreenTest : BitwardenComposeTest() {
}

composeTestRule.onNodeWithTextAfterScroll("Authenticator key")
// There are 2 because of the pull-to-refresh
composeTestRule.onAllNodes(isProgressBar).assertCountEquals(2)
composeTestRule.onNode(isProgressBar).assertIsDisplayed()

composeTestRule
.onNodeWithContentDescriptionAfterScroll("Copy TOTP")
Expand All @@ -2148,8 +2144,7 @@ class VaultItemScreenTest : BitwardenComposeTest() {
}

composeTestRule.onNodeWithTextAfterScroll("Authenticator key")
// Only pull-to-refresh remains
composeTestRule.onAllNodes(isProgressBar).assertCountEquals(1)
composeTestRule.onNode(isProgressBar).assertDoesNotExist()

composeTestRule
.onNodeWithContentDescription("Copy TOTP")
Expand Down Expand Up @@ -2351,22 +2346,19 @@ class VaultItemScreenTest : BitwardenComposeTest() {
mutableStateFlow.update {
it.copy(viewState = VaultItemState.ViewState.Loading)
}
// There are 2 because of the pull-to-refresh
composeTestRule.onAllNodes(isProgressBar).assertCountEquals(2)
composeTestRule.onNode(isProgressBar).assertIsDisplayed()

mutableStateFlow.update {
it.copy(viewState = VaultItemState.ViewState.Error("Fail".asText()))
}
// Only pull-to-refresh remains
composeTestRule.onAllNodes(isProgressBar).assertCountEquals(1)
composeTestRule.onNode(isProgressBar).assertDoesNotExist()

mutableStateFlow.update { currentState ->
updateLoginType(currentState) {
copy(totpCodeItemData = null)
}
}
// Only pull-to-refresh remains
composeTestRule.onAllNodes(isProgressBar).assertCountEquals(1)
composeTestRule.onNode(isProgressBar).assertDoesNotExist()
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.x8bit.bitwarden.ui.vault.feature.itemlisting

import androidx.compose.ui.test.assert
import androidx.compose.ui.test.assertCountEquals
import androidx.compose.ui.test.assertIsDisplayed
import androidx.compose.ui.test.assertIsNotDisplayed
import androidx.compose.ui.test.filterToOne
Expand Down Expand Up @@ -581,9 +580,7 @@ class VaultItemListingScreenTest : BitwardenComposeTest() {
@Test
fun `progressbar should be displayed according to state`() {
mutableStateFlow.update { DEFAULT_STATE }

// There are 2 because of the pull-to-refresh
composeTestRule.onAllNodes(isProgressBar).assertCountEquals(2)
composeTestRule.onNode(isProgressBar).assertIsDisplayed()

mutableStateFlow.update {
it.copy(
Expand All @@ -595,9 +592,7 @@ class VaultItemListingScreenTest : BitwardenComposeTest() {
),
)
}

// Only pull-to-refresh remains
composeTestRule.onAllNodes(isProgressBar).assertCountEquals(1)
composeTestRule.onNode(isProgressBar).assertDoesNotExist()
}

@Test
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ androdixAutofill = "1.3.0"
androidxBiometrics = "1.2.0-alpha05"
androidxBrowser = "1.9.0"
androidxCamera = "1.4.2"
androidxComposeBom = "2025.09.00"
androidxComposeBom = "2025.09.01"
androidxCore = "1.17.0"
androidxCredentials = "1.5.0"
androidxCredentialsProviderEvents = "1.0.0-alpha02"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import androidx.compose.foundation.layout.union
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.windowInsetsPadding
import androidx.compose.foundation.layout.wrapContentWidth
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.FabPosition
import androidx.compose.material3.Scaffold
import androidx.compose.material3.ScaffoldDefaults
Expand Down Expand Up @@ -59,7 +58,6 @@ import com.bitwarden.ui.platform.util.rememberWindowSize
* The [overlay] is a nonstandard [Composable] that is placed over top the `utilityBar` and
* `content`.
*/
@OptIn(ExperimentalMaterial3Api::class)
@Suppress("LongMethod")
@Composable
fun BitwardenScaffold(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import androidx.compose.foundation.layout.requiredSizeIn
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.PlainTooltip
import androidx.compose.material3.Text
import androidx.compose.material3.TooltipDefaults
import androidx.compose.material3.TooltipScope
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
Expand Down Expand Up @@ -42,7 +43,7 @@ fun TooltipScope.BitwardenToolTip(
) {
PlainTooltip(
modifier = modifier.requiredSizeIn(minWidth = MIN_TOOLTIP_WIDTH),
caretSize = DpSize(width = 24.dp, height = 12.dp),
caretShape = TooltipDefaults.caretShape(caretSize = DpSize(width = 24.dp, height = 12.dp)),
shape = BitwardenTheme.shapes.coachmark,
contentColor = BitwardenTheme.colorScheme.text.primary,
containerColor = BitwardenTheme.colorScheme.background.secondary,
Expand Down