feat(chat): stabilize multi-image attachment picker (#986)

This commit is contained in:
AlexDev_ authored and GitHub committed 2026-08-27 10:50:55 +03:00
1 parent c7d7abf4a1
commit 0ae5ed4db2
11 files changed
+432 -55

No files matched your search

@@ -1305,6 +1305,24 @@ class ChatViewModelTest {
assertEquals("dummy.txt", pending[0].name)
}
@Test
fun addAttachments_keepsEverySelectedImageInOrder() =
runTest {
val viewModel = createViewModel()
advanceUntilIdle()
val selected =
listOf(
Attachment("content://image/1", "one.jpg", "image/jpeg", 100L),
Attachment("content://image/2", "two.png", "image/png", 200L),
Attachment("content://image/3", "three.webp", "image/webp", 300L),
)
viewModel.addAttachments(selected)
advanceUntilIdle()
assertEquals(selected, viewModel.uiState.value.pendingAttachments)
}
@Test
fun testRemoveAttachment_validIndex() =
runTest {