refactor: coroutine dispatchers and modernize testing infrastructure (#4901)
Some checks are pending
Dependency Submission / dependency-submission (push) Waiting to run
Main CI (Verify & Build) / validate-and-build (push) Waiting to run
Main Push Changelog / Generate main push changelog (push) Waiting to run

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
James Rich 2026-03-23 20:31:48 -05:00 committed by GitHub
parent 664ebf218e
commit 96060a0a4d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
36 changed files with 621 additions and 182 deletions

View file

@ -129,8 +129,8 @@ class CompassViewModelTest {
}
// Bearing from (0,0) to (1,1) is approx 45 degrees
assertEquals(45f, state.bearing!!, 0.5f)
assertEquals(0f, state.heading!!, 0.1f)
assertEquals(45f, state.bearing, 0.5f)
assertEquals(0f, state.heading, 0.1f)
assertTrue(state.hasTargetPosition)
cancelAndIgnoreRemainingEvents()

View file

@ -24,9 +24,9 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.StandardTestDispatcher
import kotlinx.coroutines.test.TestScope
import org.meshtastic.core.model.Node
import org.meshtastic.core.model.RadioController
import org.meshtastic.core.repository.NodeRepository
import org.meshtastic.core.repository.ServiceRepository
import org.meshtastic.core.testing.FakeNodeRepository
import org.meshtastic.core.testing.FakeRadioController
import org.meshtastic.core.ui.util.AlertManager
import org.meshtastic.proto.User
import kotlin.test.Test
@ -34,9 +34,9 @@ import kotlin.test.Test
@OptIn(ExperimentalCoroutinesApi::class)
class NodeManagementActionsTest {
private val nodeRepository = mock<NodeRepository>(MockMode.autofill)
private val nodeRepository = FakeNodeRepository()
private val serviceRepository = mock<ServiceRepository>(MockMode.autofill)
private val radioController = mock<RadioController>(MockMode.autofill)
private val radioController = FakeRadioController()
private val alertManager = mock<AlertManager>(MockMode.autofill)
private val testDispatcher = StandardTestDispatcher()
private val testScope = TestScope(testDispatcher)