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
Expand Up @@ -182,6 +182,7 @@ private fun SetupAutoFillContent(
BitwardenFilledButton(
label = stringResource(id = BitwardenString.continue_text),
onClick = onContinueClick,
isEnabled = state.autofillEnabled,
modifier = Modifier
.fillMaxWidth()
.standardHorizontalMargin(),
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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 {
Expand Down