Harden driver app realtime release

This commit is contained in:
admin
2026-07-05 03:15:54 +02:00
parent 72db88b25c
commit b1a34105f1
17 changed files with 1226 additions and 385 deletions
@@ -199,6 +199,22 @@ class DriverUiRulesTest {
assertFalse(shouldShowDispatchSheetReminderCard(null))
}
@Test
fun explainsOfflineStateWithoutCachedSync() {
assertEquals(
"Brak połączenia z serwerem. Sprawdź internet i spróbuj ponownie.",
offlineStaleBannerMessage(isOnline = false, isStale = false, syncLabel = "brak zapisanej synchronizacji"),
)
}
@Test
fun explainsStaleCachedDataWhenOnline() {
assertEquals(
"Dane mogą być nieaktualne. Ostatnia synchronizacja: 12:30.",
offlineStaleBannerMessage(isOnline = true, isStale = true, syncLabel = "12:30"),
)
}
@Test
fun labelsDispatchSheetActionByStatusAndLocalUploadQueue() {
assertEquals("Zrób zdjęcie", dispatchSheetPrimaryActionLabel(dispatchReminder(status = "missing"), hasQueuedUpload = false))
@@ -3,6 +3,7 @@ package pl.firmatpp.kierowca.ui
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Test
import pl.firmatpp.kierowca.ui.theme.AppThemeMode
class DriverUiStateTest {
@Test
@@ -12,4 +13,11 @@ class DriverUiStateTest {
assertEquals(DriverScreen.Initializing, state.screen)
assertTrue(state.loading)
}
@Test
fun startsWithMaterial3ThemeMode() {
val state = DriverUiState()
assertEquals(AppThemeMode.Material3, state.themeMode)
}
}
@@ -0,0 +1,23 @@
package pl.firmatpp.kierowca.ui.theme
import org.junit.Assert.assertEquals
import org.junit.Test
class AppThemeModeTest {
@Test
fun parsesStoredMaterial3Value() {
assertEquals(AppThemeMode.Material3, AppThemeMode.fromStoredValue("material3"))
}
@Test
fun fallsBackToCurrentForUnknownStoredValue() {
assertEquals(AppThemeMode.Material3, AppThemeMode.fromStoredValue("future-theme"))
assertEquals(AppThemeMode.Material3, AppThemeMode.fromStoredValue(null))
}
@Test
fun storesStablePreferenceValues() {
assertEquals("current", AppThemeMode.Current.storedValue)
assertEquals("material3", AppThemeMode.Material3.storedValue)
}
}