location name in notifications

This commit is contained in:
callebtc
2025-08-28 15:26:33 +02:00
parent 3ea2aed9a4
commit e347109978
4 changed files with 80 additions and 13 deletions
@@ -107,4 +107,38 @@ class NotificationManagerTest {
notificationManager.showActiveUserNotification(listOf("peer-3"))
verify(notificationManagerCompat, times(1)).notify(any(), any())
}
@Test
fun `geohash notification includes location name when available`() {
notificationManager.setAppBackgroundState(true)
notificationManager.setCurrentGeohash("abc123")
notificationManager.showGeohashNotification(
geohash = "abc123",
senderNickname = "testuser",
messageContent = "Hello world",
isMention = false,
isFirstMessage = false,
locationName = "San Francisco"
)
verify(notificationManagerCompat, times(1)).notify(any(), any())
}
@Test
fun `geohash notification works without location name`() {
notificationManager.setAppBackgroundState(true)
notificationManager.setCurrentGeohash("abc123")
notificationManager.showGeohashNotification(
geohash = "abc123",
senderNickname = "testuser",
messageContent = "Hello world",
isMention = false,
isFirstMessage = false,
locationName = null
)
verify(notificationManagerCompat, times(1)).notify(any(), any())
}
}