mirror of
https://github.com/bitwarden/android.git
synced 2025-12-10 20:07:59 -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,
|
onTotpSetupClick: () -> Unit,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
) {
|
) {
|
||||||
BitwardenTextField(
|
BitwardenPasswordField(
|
||||||
label = stringResource(id = R.string.authenticator_key),
|
label = stringResource(id = R.string.authenticator_key),
|
||||||
value = totpKey.orEmpty(),
|
value = totpKey.orEmpty(),
|
||||||
onValueChange = {},
|
onValueChange = {},
|
||||||
@ -400,7 +400,7 @@ private fun TotpRow(
|
|||||||
.testTag("SetupTotpButton"),
|
.testTag("SetupTotpButton"),
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
textFieldTestTag = "LoginTotpEntry",
|
passwordFieldTestTag = "LoginTotpEntry",
|
||||||
cardStyle = CardStyle.Full,
|
cardStyle = CardStyle.Full,
|
||||||
modifier = modifier
|
modifier = modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
|
|||||||
@ -985,7 +985,20 @@ class VaultAddEditScreenTest : BitwardenComposeTest() {
|
|||||||
|
|
||||||
composeTestRule
|
composeTestRule
|
||||||
.onNodeWithTextAfterScroll("Authenticator key")
|
.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")
|
.assertTextEquals("Authenticator key", "TestCode")
|
||||||
|
.assertIsEnabled()
|
||||||
|
|
||||||
mutableStateFlow.update { currentState ->
|
mutableStateFlow.update { currentState ->
|
||||||
updateLoginType(currentState) { copy(totp = "NewTestCode") }
|
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")
|
@Suppress("MaxLineLength")
|
||||||
@Test
|
@Test
|
||||||
fun `in ItemType_Login state the totp text field click on trailing icon should call ClearTotpKeyClick`() {
|
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