mirror of
https://github.com/bitwarden/android.git
synced 2026-10-23 11:33:22 -05:00
Disable inline autofill toggle when autofill is disabled (#674)
This commit is contained in:
1 parent
b77de7ba4d
commit
cb306a8377
4 files changed
+60
-3
No files matched your search
+37
@@ -2,6 +2,8 @@ package com.x8bit.bitwarden.ui.platform.feature.settings.autofill
|
||||
|
||||
import androidx.compose.ui.test.assert
|
||||
import androidx.compose.ui.test.assertIsDisplayed
|
||||
import androidx.compose.ui.test.assertIsEnabled
|
||||
import androidx.compose.ui.test.assertIsNotEnabled
|
||||
import androidx.compose.ui.test.assertIsOff
|
||||
import androidx.compose.ui.test.assertIsOn
|
||||
import androidx.compose.ui.test.filterToOne
|
||||
@@ -129,6 +131,12 @@ class AutoFillScreenTest : BaseComposeTest() {
|
||||
|
||||
@Test
|
||||
fun `on use inline auto fill toggle should send UseInlineAutofillClick`() {
|
||||
mutableStateFlow.update {
|
||||
it.copy(
|
||||
isAutoFillServicesEnabled = true,
|
||||
isUseInlineAutoFillEnabled = false,
|
||||
)
|
||||
}
|
||||
composeTestRule
|
||||
.onNodeWithText("Use inline autofill")
|
||||
.performScrollTo()
|
||||
@@ -149,6 +157,35 @@ class AutoFillScreenTest : BaseComposeTest() {
|
||||
.assertIsOn()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `use inline autofill should be disabled or enabled according to state`() {
|
||||
mutableStateFlow.update {
|
||||
it.copy(
|
||||
isAutoFillServicesEnabled = true,
|
||||
isUseInlineAutoFillEnabled = true,
|
||||
)
|
||||
}
|
||||
|
||||
composeTestRule
|
||||
.onNodeWithText("Use inline autofill")
|
||||
.performScrollTo()
|
||||
.assertIsOn()
|
||||
.assertIsEnabled()
|
||||
|
||||
mutableStateFlow.update {
|
||||
it.copy(
|
||||
isAutoFillServicesEnabled = false,
|
||||
isUseInlineAutoFillEnabled = true,
|
||||
)
|
||||
}
|
||||
|
||||
composeTestRule
|
||||
.onNodeWithText("Use inline autofill")
|
||||
.performScrollTo()
|
||||
.assertIsOn()
|
||||
.assertIsNotEnabled()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `on copy TOTP automatically toggle should send CopyTotpAutomaticallyClick`() {
|
||||
composeTestRule
|
||||
|
||||
Reference in new issue
Block a user