mirror of
https://github.com/bitwarden/android.git
synced 2026-03-12 05:04:17 -05:00
PM-26151: Disable continue button for Autofill onboarding flow when autofill is disabled (#5933)
This commit is contained in:
@@ -182,6 +182,7 @@ private fun SetupAutoFillContent(
|
||||
BitwardenFilledButton(
|
||||
label = stringResource(id = BitwardenString.continue_text),
|
||||
onClick = onContinueClick,
|
||||
isEnabled = state.autofillEnabled,
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.standardHorizontalMargin(),
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user