From e91ba77105b71af1fe70588792008ba3f0eb16ca Mon Sep 17 00:00:00 2001 From: David Perez Date: Wed, 24 Sep 2025 11:55:50 -0500 Subject: [PATCH] PM-26151: Disable continue button for Autofill onboarding flow when autofill is disabled (#5933) --- .../auth/feature/accountsetup/SetupAutofillScreen.kt | 1 + .../feature/accountsetup/SetupAutofillScreenTest.kt | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/app/src/main/kotlin/com/x8bit/bitwarden/ui/auth/feature/accountsetup/SetupAutofillScreen.kt b/app/src/main/kotlin/com/x8bit/bitwarden/ui/auth/feature/accountsetup/SetupAutofillScreen.kt index b1a762c69d..cfea6d44f9 100644 --- a/app/src/main/kotlin/com/x8bit/bitwarden/ui/auth/feature/accountsetup/SetupAutofillScreen.kt +++ b/app/src/main/kotlin/com/x8bit/bitwarden/ui/auth/feature/accountsetup/SetupAutofillScreen.kt @@ -182,6 +182,7 @@ private fun SetupAutoFillContent( BitwardenFilledButton( label = stringResource(id = BitwardenString.continue_text), onClick = onContinueClick, + isEnabled = state.autofillEnabled, modifier = Modifier .fillMaxWidth() .standardHorizontalMargin(), diff --git a/app/src/test/kotlin/com/x8bit/bitwarden/ui/auth/feature/accountsetup/SetupAutofillScreenTest.kt b/app/src/test/kotlin/com/x8bit/bitwarden/ui/auth/feature/accountsetup/SetupAutofillScreenTest.kt index 92e3c77eb1..f939edb0cf 100644 --- a/app/src/test/kotlin/com/x8bit/bitwarden/ui/auth/feature/accountsetup/SetupAutofillScreenTest.kt +++ b/app/src/test/kotlin/com/x8bit/bitwarden/ui/auth/feature/accountsetup/SetupAutofillScreenTest.kt @@ -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 {