diff options
| author | Harsh Shandilya <me@msfjarvis.dev> | 2022-03-11 01:52:39 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-10 20:22:39 +0000 |
| commit | 2f034bc2372d29b4ddebf74d532279073fb3d92b (patch) | |
| tree | dc9197276622c56f32c9b395e9339a046f608103 /format-common/src/test/kotlin/dev/msfjarvis/aps/util/time | |
| parent | 3e988b2a3428c3759535a2bd1f3e1ba0b5e411a3 (diff) | |
| download | HardenedPass-2f034bc2372d29b4ddebf74d532279073fb3d92b.tar.gz HardenedPass-2f034bc2372d29b4ddebf74d532279073fb3d92b.zip | |
Show remaining time in TOTP field (#1766)
* Pass down remaining time for TOTPs to UI layer
* format-common: switch TOTP flow to use co-operative cancelation
* format-common: add a regression test for OTP duration calculation
* Abstract out labels
* Switch to launchIn
Diffstat (limited to 'format-common/src/test/kotlin/dev/msfjarvis/aps/util/time')
| -rw-r--r-- | format-common/src/test/kotlin/dev/msfjarvis/aps/util/time/TestClocks.kt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/format-common/src/test/kotlin/dev/msfjarvis/aps/util/time/TestClocks.kt b/format-common/src/test/kotlin/dev/msfjarvis/aps/util/time/TestClocks.kt index 5098bec9..ee74a40d 100644 --- a/format-common/src/test/kotlin/dev/msfjarvis/aps/util/time/TestClocks.kt +++ b/format-common/src/test/kotlin/dev/msfjarvis/aps/util/time/TestClocks.kt @@ -24,4 +24,10 @@ class TestUserClock(instant: Instant) : UserClock() { override fun getZone(): ZoneId = UTC override fun instant(): Instant = clock.instant() + + companion object { + fun withAddedSeconds(secondsToAdd: Long): TestUserClock { + return TestUserClock(Instant.EPOCH.plusSeconds(secondsToAdd)) + } + } } |
