Hilt: fix test
This commit is contained in:
parent
c87d276f8a
commit
e1f4e4f934
@ -46,6 +46,7 @@ class SharedSecureStorageViewModelTest {
|
|||||||
|
|
||||||
private val stringProvider = FakeStringProvider()
|
private val stringProvider = FakeStringProvider()
|
||||||
private val session = FakeSession()
|
private val session = FakeSession()
|
||||||
|
val args = SharedSecureStorageActivity.Args(keyId = null, emptyList(), "alias")
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `given a key info with passphrase when initialising then step is EnterPassphrase`() {
|
fun `given a key info with passphrase when initialising then step is EnterPassphrase`() {
|
||||||
@ -123,14 +124,15 @@ class SharedSecureStorageViewModelTest {
|
|||||||
test.assertEvents(SharedSecureStorageViewEvent.Dismiss)
|
test.assertEvents(SharedSecureStorageViewEvent.Dismiss)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun createViewModel() = SharedSecureStorageViewModel(
|
private fun createViewModel(): SharedSecureStorageViewModel {
|
||||||
SharedSecureStorageViewState(),
|
return SharedSecureStorageViewModel(
|
||||||
SharedSecureStorageActivity.Args(keyId = null, emptyList(), "alias"),
|
SharedSecureStorageViewState(args),
|
||||||
stringProvider.instance,
|
stringProvider.instance,
|
||||||
session
|
session
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
private fun aViewState(hasPassphrase: Boolean, step: SharedSecureStorageViewState.Step) = SharedSecureStorageViewState(
|
private fun aViewState(hasPassphrase: Boolean, step: SharedSecureStorageViewState.Step) = SharedSecureStorageViewState(args).copy(
|
||||||
ready = true,
|
ready = true,
|
||||||
hasPassphrase = hasPassphrase,
|
hasPassphrase = hasPassphrase,
|
||||||
checkingSSSSAction = Uninitialized,
|
checkingSSSSAction = Uninitialized,
|
||||||
|
Loading…
Reference in New Issue
Block a user