PM-26151: Disable continue button for Autofill onboarding flow when autofill is disabled (#5933)

This commit is contained in:
David Perez
2025-09-24 11:55:50 -05:00
committed by GitHub
parent cc685b2307
commit e91ba77105
2 changed files with 12 additions and 0 deletions

View File

@@ -182,6 +182,7 @@ private fun SetupAutoFillContent(
BitwardenFilledButton(
label = stringResource(id = BitwardenString.continue_text),
onClick = onContinueClick,
isEnabled = state.autofillEnabled,
modifier = Modifier
.fillMaxWidth()
.standardHorizontalMargin(),

View File

@@ -1,6 +1,8 @@
package com.x8bit.bitwarden.ui.auth.feature.accountsetup
import androidx.compose.ui.test.assertIsDisplayed
import androidx.compose.ui.test.assertIsEnabled
import androidx.compose.ui.test.assertIsNotEnabled
import androidx.compose.ui.test.filterToOne
import androidx.compose.ui.test.hasAnyAncestor
import androidx.compose.ui.test.isDialog
@@ -77,6 +79,7 @@ class SetupAutofillScreenTest : BitwardenComposeTest() {
@Test
fun `Continue click should send correct action`() {
mutableStateFlow.update { it.copy(autofillEnabled = true) }
composeTestRule
.onNodeWithText("Continue")
.performScrollTo()
@@ -127,6 +130,14 @@ class SetupAutofillScreenTest : BitwardenComposeTest() {
}
}
@Test
fun `Continue button is enabled according to state`() {
mutableStateFlow.update { it.copy(autofillEnabled = false) }
composeTestRule.onNodeWithText(text = "Continue").assertIsNotEnabled()
mutableStateFlow.update { it.copy(autofillEnabled = true) }
composeTestRule.onNodeWithText(text = "Continue").assertIsEnabled()
}
@Test
fun `Show autofill fallback dialog when dialog state is AutoFillFallbackDialog`() {
mutableStateFlow.update {