mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-03-14 03:46:25 -04:00
refactor(NodeItem): replace NodeInfo with NodeEntity
This commit is contained in:
@@ -140,7 +140,9 @@ class NodeInfoDaoTest {
|
||||
@Test
|
||||
fun testSortByDistance() = runBlocking {
|
||||
val nodes = getNodes(sort = NodeSortOption.DISTANCE)
|
||||
val sortedNodes = nodes.sortedBy { it.distance(ourNode) }
|
||||
val sortedNodes = nodes.sortedWith( // nodes with invalid (null) positions at the end
|
||||
compareBy<NodeEntity> { it.validPosition == null }.thenBy { it.distance(ourNode) }
|
||||
)
|
||||
assertEquals(sortedNodes, nodes)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user