BIT-1432: Add FifteenMinutes to VaultTimeout (#565)

This commit is contained in:
Brian Yencho 2024-01-10 14:26:33 -06:00 committed by Álison Fernandes
parent 6b12dbdc4c
commit 9f95c26c2f
5 changed files with 18 additions and 0 deletions

View file

@ -46,6 +46,15 @@ sealed class VaultTimeout : Parcelable {
override val vaultTimeoutInMinutes: Int get() = 5
}
/**
* The vault should time out after fifteen minutes.
*/
@Parcelize
data object FifteenMinutes : VaultTimeout() {
override val type: Type get() = Type.FIFTEEN_MINUTES
override val vaultTimeoutInMinutes: Int get() = 15
}
/**
* The vault should time out after thirty minutes.
*/
@ -108,6 +117,7 @@ sealed class VaultTimeout : Parcelable {
IMMEDIATELY,
ONE_MINUTE,
FIVE_MINUTES,
FIFTEEN_MINUTES,
THIRTY_MINUTES,
ONE_HOUR,
FOUR_HOURS,

View file

@ -133,6 +133,7 @@ class AccountSecurityViewModel @Inject constructor(
VaultTimeout.Type.IMMEDIATELY -> VaultTimeout.Immediately
VaultTimeout.Type.ONE_MINUTE -> VaultTimeout.OneMinute
VaultTimeout.Type.FIVE_MINUTES -> VaultTimeout.FiveMinutes
VaultTimeout.Type.FIFTEEN_MINUTES -> VaultTimeout.FifteenMinutes
VaultTimeout.Type.THIRTY_MINUTES -> VaultTimeout.ThirtyMinutes
VaultTimeout.Type.ONE_HOUR -> VaultTimeout.OneHour
VaultTimeout.Type.FOUR_HOURS -> VaultTimeout.FourHours

View file

@ -13,6 +13,7 @@ val VaultTimeout.Type.displayLabel: Text
VaultTimeout.Type.IMMEDIATELY -> R.string.immediately
VaultTimeout.Type.ONE_MINUTE -> R.string.one_minute
VaultTimeout.Type.FIVE_MINUTES -> R.string.five_minutes
VaultTimeout.Type.FIFTEEN_MINUTES -> R.string.fifteen_minutes
VaultTimeout.Type.THIRTY_MINUTES -> R.string.thirty_minutes
VaultTimeout.Type.ONE_HOUR -> R.string.one_hour
VaultTimeout.Type.FOUR_HOURS -> R.string.four_hours

View file

@ -164,6 +164,10 @@ class AccountSecurityScreenTest : BaseComposeTest() {
.onAllNodesWithText("5 minutes")
.filterToOne(hasAnyAncestor(isDialog()))
.assertIsDisplayed()
composeTestRule
.onAllNodesWithText("15 minutes")
.filterToOne(hasAnyAncestor(isDialog()))
.assertIsDisplayed()
composeTestRule
.onAllNodesWithText("30 minutes")
.filterToOne(hasAnyAncestor(isDialog()))
@ -179,6 +183,7 @@ class AccountSecurityScreenTest : BaseComposeTest() {
composeTestRule
.onAllNodesWithText("On app restart")
.filterToOne(hasAnyAncestor(isDialog()))
.performScrollTo()
.assertIsDisplayed()
composeTestRule
.onAllNodesWithText("Never")

View file

@ -13,6 +13,7 @@ class VaultTimeoutExtensionsTest {
VaultTimeout.Type.IMMEDIATELY to R.string.immediately.asText(),
VaultTimeout.Type.ONE_MINUTE to R.string.one_minute.asText(),
VaultTimeout.Type.FIVE_MINUTES to R.string.five_minutes.asText(),
VaultTimeout.Type.FIFTEEN_MINUTES to R.string.fifteen_minutes.asText(),
VaultTimeout.Type.THIRTY_MINUTES to R.string.thirty_minutes.asText(),
VaultTimeout.Type.ONE_HOUR to R.string.one_hour.asText(),
VaultTimeout.Type.FOUR_HOURS to R.string.four_hours.asText(),