Fix tests.

This commit is contained in:
Benoit Marty 2024-02-20 17:48:08 +01:00 committed by Benoit Marty
parent 4990aa38d3
commit 347edb67ab
2 changed files with 12 additions and 7 deletions

View file

@ -21,8 +21,10 @@ import io.element.android.libraries.matrix.api.sync.SyncState
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
class FakeSyncService : SyncService {
private val syncStateFlow = MutableStateFlow(SyncState.Idle)
class FakeSyncService(
initialState: SyncState = SyncState.Idle
) : SyncService {
private val syncStateFlow = MutableStateFlow(initialState)
fun simulateError() {
syncStateFlow.value = SyncState.Error