test: make viewmodel and notification receiver tests deterministic (#1207)

This commit is contained in:
m57 authored and GitHub committed 2026-09-21 16:53:10 +03:00
1 parent 29fdb52978
commit fa2b388b24
9 files changed
+52 -66

No files matched your search

@@ -33,6 +33,7 @@ import com.m57.hermescontrol.data.repository.KanbanRepositoryImpl
import com.m57.hermescontrol.data.ws.KanbanEventsClient
import com.m57.hermescontrol.data.ws.KanbanLiveStatus
import com.m57.hermescontrol.ui.common.ToastHost
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.async
@@ -166,6 +167,7 @@ class KanbanViewModel(
private var eventsBoard: String? = null
private var reloadJob: Job? = null
private var currentLoadGen: Int = 0
internal var ioDispatcher: CoroutineDispatcher = Dispatchers.IO
fun loadBoards() {
val endpoint = endpointProvider()
@@ -184,7 +186,7 @@ class KanbanViewModel(
coroutineScope {
val prefetchedBoardDeferred =
if (previouslySelectedId != null) {
async(Dispatchers.IO) {
async(ioDispatcher) {
repository.getBoard(
board = previouslySelectedId,
includeArchived = _uiState.value.includeArchived,