tests : refactor some classes

This commit is contained in:
ganfra 2024-07-31 21:14:29 +02:00
parent 97d4e639e5
commit 0b32dbebb5
6 changed files with 16 additions and 15 deletions

View file

@ -95,6 +95,7 @@ import io.element.android.tests.testutils.testCoroutineDispatchers
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.cancel
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.test.TestScope
import kotlinx.coroutines.test.runTest
import org.junit.Rule
@ -219,7 +220,7 @@ class RoomListPresenterTest {
val encryptionService = FakeEncryptionService().apply {
emitRecoveryState(RecoveryState.INCOMPLETE)
}
val syncService = FakeSyncService(initialState = SyncState.Running)
val syncService = FakeSyncService(MutableStateFlow(SyncState.Running))
val presenter = createRoomListPresenter(
client = FakeMatrixClient(roomListService = roomListService, encryptionService = encryptionService, syncService = syncService),
coroutineScope = scope,
@ -250,7 +251,7 @@ class RoomListPresenterTest {
sessionVerificationService = FakeSessionVerificationService().apply {
givenNeedsSessionVerification(false)
},
syncService = FakeSyncService(initialState = SyncState.Running)
syncService = FakeSyncService(MutableStateFlow(SyncState.Running))
)
val scope = CoroutineScope(context = coroutineContext + SupervisorJob())
val presenter = createRoomListPresenter(