Popraw obsługę galerii zdjęć kierowcy
This commit is contained in:
@@ -30,4 +30,34 @@ class DriverUiRulesTest {
|
||||
assertEquals(2, inlinePhotoGridRows(3))
|
||||
assertEquals(3, inlinePhotoGridRows(5))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun countsServerPhotosAndLocalUploadsAsVisibleAttachments() {
|
||||
assertEquals(0, visiblePhotoAttachmentCount(serverPhotoCount = 0, localUploadCount = 0))
|
||||
assertEquals(1, visiblePhotoAttachmentCount(serverPhotoCount = 0, localUploadCount = 1))
|
||||
assertEquals(3, visiblePhotoAttachmentCount(serverPhotoCount = 1, localUploadCount = 2))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun usesCreatedAtBeforeTakenAtForNewestFirstPhotoSorting() {
|
||||
val fallback = 100L
|
||||
|
||||
assertEquals(
|
||||
1_782_892_800_000L,
|
||||
routePhotoSortEpochMillis(
|
||||
createdAt = "2026-07-01T10:00:00+02:00",
|
||||
takenAt = "2026-07-01T08:00:00+02:00",
|
||||
fallback = fallback,
|
||||
),
|
||||
)
|
||||
assertEquals(
|
||||
1_782_885_600_000L,
|
||||
routePhotoSortEpochMillis(
|
||||
createdAt = null,
|
||||
takenAt = "2026-07-01T08:00:00+02:00",
|
||||
fallback = fallback,
|
||||
),
|
||||
)
|
||||
assertEquals(fallback, routePhotoSortEpochMillis(createdAt = null, takenAt = null, fallback = fallback))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user