Skip to content

Commit e1f4e4f

Browse files
committed
Hilt: fix test
1 parent c87d276 commit e1f4e4f

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

vector/src/test/java/im/vector/app/features/crypto/quads/SharedSecureStorageViewModelTest.kt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class SharedSecureStorageViewModelTest {
4646

4747
private val stringProvider = FakeStringProvider()
4848
private val session = FakeSession()
49+
val args = SharedSecureStorageActivity.Args(keyId = null, emptyList(), "alias")
4950

5051
@Test
5152
fun `given a key info with passphrase when initialising then step is EnterPassphrase`() {
@@ -123,14 +124,15 @@ class SharedSecureStorageViewModelTest {
123124
test.assertEvents(SharedSecureStorageViewEvent.Dismiss)
124125
}
125126

126-
private fun createViewModel() = SharedSecureStorageViewModel(
127-
SharedSecureStorageViewState(),
128-
SharedSecureStorageActivity.Args(keyId = null, emptyList(), "alias"),
129-
stringProvider.instance,
130-
session
131-
)
127+
private fun createViewModel(): SharedSecureStorageViewModel {
128+
return SharedSecureStorageViewModel(
129+
SharedSecureStorageViewState(args),
130+
stringProvider.instance,
131+
session
132+
)
133+
}
132134

133-
private fun aViewState(hasPassphrase: Boolean, step: SharedSecureStorageViewState.Step) = SharedSecureStorageViewState(
135+
private fun aViewState(hasPassphrase: Boolean, step: SharedSecureStorageViewState.Step) = SharedSecureStorageViewState(args).copy(
134136
ready = true,
135137
hasPassphrase = hasPassphrase,
136138
checkingSSSSAction = Uninitialized,

0 commit comments

Comments
 (0)