feat: add unread message count

This commit is contained in:
andrekir
2024-06-15 12:18:26 -03:00
committed by Andre K
parent e4f5d9b89c
commit d7013e1386
7 changed files with 89 additions and 4 deletions

View File

@@ -125,6 +125,24 @@ class PacketDaoTest {
}
}
@Test
fun test_getUnreadCount() = runBlocking {
testContactKeys.forEach { contactKey ->
val unreadCount = packetDao.getUnreadCount(contactKey)
assertEquals(SAMPLE_SIZE, unreadCount)
}
}
@Test
fun test_clearUnreadCount() = runBlocking {
val timestamp = System.currentTimeMillis()
testContactKeys.forEach { contactKey ->
packetDao.clearUnreadCount(contactKey, timestamp)
val unreadCount = packetDao.getUnreadCount(contactKey)
assertEquals(0, unreadCount)
}
}
@Test
fun test_deleteContacts() = runBlocking {
packetDao.deleteContacts(testContactKeys)