android: add mapper fallback test and checklist updates
Some checks failed
CI / test (push) Failing after 2m9s
Some checks failed
CI / test (push) Failing after 2m9s
This commit is contained in:
@@ -233,3 +233,7 @@
|
|||||||
- Added gradient wallpaper-like chat background layer in `ChatScreen`.
|
- Added gradient wallpaper-like chat background layer in `ChatScreen`.
|
||||||
- Kept pinned/composer/action surfaces on semi-transparent containers to preserve readability over wallpaper.
|
- Kept pinned/composer/action surfaces on semi-transparent containers to preserve readability over wallpaper.
|
||||||
- Updated Telegram UI checklist items for wallpaper and overlay readability.
|
- Updated Telegram UI checklist items for wallpaper and overlay readability.
|
||||||
|
|
||||||
|
### Step 38 - Quality/docs / mapper fallback coverage
|
||||||
|
- Added `MessageMappersTest` to verify reply preview fallback resolution from Room self-relation (`reply_to_message_id`).
|
||||||
|
- Updated Android master checklist for completed chat list tabs/filters coverage.
|
||||||
|
|||||||
@@ -0,0 +1,70 @@
|
|||||||
|
package ru.daemonlord.messenger.data.message.mapper
|
||||||
|
|
||||||
|
import org.junit.Assert.assertEquals
|
||||||
|
import org.junit.Assert.assertTrue
|
||||||
|
import org.junit.Test
|
||||||
|
import ru.daemonlord.messenger.data.message.local.entity.MessageEntity
|
||||||
|
import ru.daemonlord.messenger.data.message.local.model.MessageLocalModel
|
||||||
|
|
||||||
|
class MessageMappersTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun toDomain_usesReplyRelationFallbackWhenPreviewFieldsMissing() {
|
||||||
|
val replyMessage = messageEntity(
|
||||||
|
id = 10,
|
||||||
|
senderId = 44,
|
||||||
|
senderDisplayName = "Alice",
|
||||||
|
text = "Original message",
|
||||||
|
)
|
||||||
|
val sourceMessage = messageEntity(
|
||||||
|
id = 11,
|
||||||
|
senderId = 55,
|
||||||
|
senderDisplayName = "Bob",
|
||||||
|
text = "Reply body",
|
||||||
|
replyToMessageId = 10,
|
||||||
|
replyPreviewText = null,
|
||||||
|
replyPreviewSenderName = null,
|
||||||
|
)
|
||||||
|
val localModel = MessageLocalModel(
|
||||||
|
message = sourceMessage,
|
||||||
|
attachments = emptyList(),
|
||||||
|
replyToMessage = replyMessage,
|
||||||
|
)
|
||||||
|
|
||||||
|
val domain = localModel.toDomain(currentUserId = 55)
|
||||||
|
|
||||||
|
assertEquals("Alice", domain.replyPreviewSenderName)
|
||||||
|
assertEquals("Original message", domain.replyPreviewText)
|
||||||
|
assertTrue(domain.isOutgoing)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun messageEntity(
|
||||||
|
id: Long,
|
||||||
|
senderId: Long,
|
||||||
|
senderDisplayName: String?,
|
||||||
|
text: String?,
|
||||||
|
replyToMessageId: Long? = null,
|
||||||
|
replyPreviewText: String? = null,
|
||||||
|
replyPreviewSenderName: String? = null,
|
||||||
|
): MessageEntity {
|
||||||
|
return MessageEntity(
|
||||||
|
id = id,
|
||||||
|
chatId = 1,
|
||||||
|
senderId = senderId,
|
||||||
|
senderDisplayName = senderDisplayName,
|
||||||
|
senderUsername = null,
|
||||||
|
senderAvatarUrl = null,
|
||||||
|
replyToMessageId = replyToMessageId,
|
||||||
|
replyPreviewText = replyPreviewText,
|
||||||
|
replyPreviewSenderName = replyPreviewSenderName,
|
||||||
|
forwardedFromMessageId = null,
|
||||||
|
forwardedFromDisplayName = null,
|
||||||
|
type = "text",
|
||||||
|
text = text,
|
||||||
|
status = "sent",
|
||||||
|
attachmentWaveformJson = null,
|
||||||
|
createdAt = "2026-03-09T10:00:00Z",
|
||||||
|
updatedAt = null,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
- [ ] Blocked users management
|
- [ ] Blocked users management
|
||||||
|
|
||||||
## 6. Список чатов
|
## 6. Список чатов
|
||||||
- [ ] Tabs/фильтры (all/private/group/channel/archive)
|
- [x] Tabs/фильтры (all/private/group/channel/archive)
|
||||||
- [x] Pinned chats
|
- [x] Pinned chats
|
||||||
- [x] Unread badge + mention badge `@`
|
- [x] Unread badge + mention badge `@`
|
||||||
- [x] Muted badge
|
- [x] Muted badge
|
||||||
|
|||||||
Reference in New Issue
Block a user