mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
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:
parent
0b2e89c46f
commit
8c964a15ca
45 changed files with 1304 additions and 61 deletions
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue