mirror of
https://github.com/bitwarden/android.git
synced 2025-12-10 09:56:45 -06:00
[PM-22568] Change totp seed field to a password field (#5350)
This commit is contained in:
parent
053dfc1647
commit
469df4495a
@ -361,7 +361,7 @@ private fun TotpRow(
|
||||
onTotpSetupClick: () -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
BitwardenTextField(
|
||||
BitwardenPasswordField(
|
||||
label = stringResource(id = R.string.authenticator_key),
|
||||
value = totpKey.orEmpty(),
|
||||
onValueChange = {},
|
||||
@ -400,7 +400,7 @@ private fun TotpRow(
|
||||
.testTag("SetupTotpButton"),
|
||||
)
|
||||
},
|
||||
textFieldTestTag = "LoginTotpEntry",
|
||||
passwordFieldTestTag = "LoginTotpEntry",
|
||||
cardStyle = CardStyle.Full,
|
||||
modifier = modifier
|
||||
.fillMaxWidth()
|
||||
|
||||
@ -985,7 +985,20 @@ class VaultAddEditScreenTest : BitwardenComposeTest() {
|
||||
|
||||
composeTestRule
|
||||
.onNodeWithTextAfterScroll("Authenticator key")
|
||||
.assertTextEquals("Authenticator key", "••••••••")
|
||||
|
||||
composeTestRule
|
||||
.onNodeWithTextAfterScroll("Authenticator key")
|
||||
.assertExists()
|
||||
.onChildren()
|
||||
.filterToOne(hasContentDescription(value = "Show"))
|
||||
.assertExists()
|
||||
.performClick()
|
||||
|
||||
composeTestRule
|
||||
.onNodeWithText("Authenticator key")
|
||||
.assertTextEquals("Authenticator key", "TestCode")
|
||||
.assertIsEnabled()
|
||||
|
||||
mutableStateFlow.update { currentState ->
|
||||
updateLoginType(currentState) { copy(totp = "NewTestCode") }
|
||||
@ -1000,6 +1013,42 @@ class VaultAddEditScreenTest : BitwardenComposeTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `in ItemType_Login state totp control should display the text provided by the state`() {
|
||||
mutableStateFlow.update { currentState ->
|
||||
updateLoginType(currentState) { copy(totp = "TestCode") }
|
||||
}
|
||||
|
||||
composeTestRule
|
||||
.onNodeWithTextAfterScroll("Authenticator key")
|
||||
.assertTextEquals("Authenticator key", "••••••••")
|
||||
|
||||
composeTestRule
|
||||
.onNodeWithTextAfterScroll("Authenticator key")
|
||||
.assertExists()
|
||||
.onChildren()
|
||||
.filterToOne(hasContentDescription(value = "Show"))
|
||||
.assertExists()
|
||||
.performClick()
|
||||
|
||||
composeTestRule
|
||||
.onNodeWithText("Authenticator key")
|
||||
.assertTextEquals("Authenticator key", "TestCode")
|
||||
.assertIsEnabled()
|
||||
|
||||
composeTestRule
|
||||
.onNodeWithText("Authenticator key")
|
||||
.assertExists()
|
||||
.onChildren()
|
||||
.filterToOne(hasContentDescription(value = "Hide"))
|
||||
.assertExists()
|
||||
.performClick()
|
||||
|
||||
composeTestRule
|
||||
.onNodeWithTextAfterScroll("Authenticator key")
|
||||
.assertTextEquals("Authenticator key", "••••••••")
|
||||
}
|
||||
|
||||
@Suppress("MaxLineLength")
|
||||
@Test
|
||||
fun `in ItemType_Login state the totp text field click on trailing icon should call ClearTotpKeyClick`() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user