feat: Integrate notification management and preferences across platforms (#4819)

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
James Rich 2026-03-16 20:17:34 -05:00 committed by GitHub
parent 0b2e89c46f
commit 8c964a15ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
45 changed files with 1304 additions and 61 deletions

View file

@ -16,7 +16,10 @@
*/
package org.meshtastic.feature.node.list
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.test.resetMain
import kotlinx.coroutines.test.runTest
import kotlinx.coroutines.test.setMain
import org.meshtastic.core.testing.FakeNodeRepository
import org.meshtastic.core.testing.FakeRadioController
import org.meshtastic.core.testing.TestDataFactory
@ -37,10 +40,16 @@ class NodeErrorHandlingTest {
@BeforeTest
fun setUp() {
kotlinx.coroutines.Dispatchers.setMain(kotlinx.coroutines.Dispatchers.Unconfined)
nodeRepository = FakeNodeRepository()
radioController = FakeRadioController()
}
@kotlin.test.AfterTest
fun tearDown() {
kotlinx.coroutines.Dispatchers.resetMain()
}
@Test
fun testGetNonexistentNode() = runTest {
val node = nodeRepository.getNode("!nonexistent")

View file

@ -16,7 +16,10 @@
*/
package org.meshtastic.feature.node.list
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.test.resetMain
import kotlinx.coroutines.test.runTest
import kotlinx.coroutines.test.setMain
import org.meshtastic.core.testing.FakeNodeRepository
import org.meshtastic.core.testing.FakeRadioController
import org.meshtastic.core.testing.TestDataFactory
@ -37,10 +40,16 @@ class NodeIntegrationTest {
@BeforeTest
fun setUp() {
kotlinx.coroutines.Dispatchers.setMain(kotlinx.coroutines.Dispatchers.Unconfined)
nodeRepository = FakeNodeRepository()
radioController = FakeRadioController()
}
@kotlin.test.AfterTest
fun tearDown() {
kotlinx.coroutines.Dispatchers.resetMain()
}
@Test
fun testPopulatingMeshWithMultipleNodes() = runTest {
// Create diverse node set

View file

@ -19,8 +19,11 @@ package org.meshtastic.feature.node.list
import androidx.lifecycle.SavedStateHandle
import io.mockk.every
import io.mockk.mockk
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.test.resetMain
import kotlinx.coroutines.test.runTest
import kotlinx.coroutines.test.setMain
import org.meshtastic.core.repository.RadioConfigRepository
import org.meshtastic.core.repository.ServiceRepository
import org.meshtastic.core.testing.FakeNodeRepository
@ -51,6 +54,7 @@ class NodeListViewModelTest {
@BeforeTest
fun setUp() {
kotlinx.coroutines.Dispatchers.setMain(kotlinx.coroutines.Dispatchers.Unconfined)
// Use real fakes
nodeRepository = FakeNodeRepository()
radioController = FakeRadioController()
@ -82,6 +86,11 @@ class NodeListViewModelTest {
)
}
@kotlin.test.AfterTest
fun tearDown() {
kotlinx.coroutines.Dispatchers.resetMain()
}
@Test
fun testInitialization() = runTest {
setUp()