Dodaj uwagi i dyktowanie na etapach trasy
This commit is contained in:
@@ -17,11 +17,19 @@ class DriverRouteProjectionTest {
|
||||
fun pendingStartProjectsPlannedRouteAsActiveWithLoadingWeight() {
|
||||
val projection = projectDriverRoute(
|
||||
route = route(status = "ZAPLANOWANA"),
|
||||
actions = listOf(action(RouteActionType.Start, RouteActionStatus.Pending, weight = 12.5)),
|
||||
actions = listOf(
|
||||
action(
|
||||
RouteActionType.Start,
|
||||
RouteActionStatus.Pending,
|
||||
weight = 12.5,
|
||||
notes = "Oczekiwanie na dokument WZ.",
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
assertEquals("W TRAKCIE", projection.route.status)
|
||||
assertEquals(12.5, projection.route.loadingWeight)
|
||||
assertEquals("Oczekiwanie na dokument WZ.", projection.route.loadingNotes)
|
||||
assertEquals("active", projection.route.trackingStatus)
|
||||
assertTrue(projection.loadingWeightPending)
|
||||
assertFalse(projection.unloadingWeightPending)
|
||||
@@ -32,11 +40,20 @@ class DriverRouteProjectionTest {
|
||||
fun pendingFinishProjectsActiveRouteAsFinishedWithUnloadingWeight() {
|
||||
val projection = projectDriverRoute(
|
||||
route = route(status = "W TRAKCIE", loadingWeight = 12.5),
|
||||
actions = listOf(action(RouteActionType.Finish, RouteActionStatus.Syncing, weight = 11.8, occurredAt = "2026-06-30T09:10:00Z")),
|
||||
actions = listOf(
|
||||
action(
|
||||
RouteActionType.Finish,
|
||||
RouteActionStatus.Syncing,
|
||||
weight = 11.8,
|
||||
notes = "Uszkodzona plomba.",
|
||||
occurredAt = "2026-06-30T09:10:00Z",
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
assertEquals("ZAKOŃCZONA", projection.route.status)
|
||||
assertEquals(11.8, projection.route.unloadingWeight)
|
||||
assertEquals("Uszkodzona plomba.", projection.route.unloadingNotes)
|
||||
assertEquals("finished", projection.route.trackingStatus)
|
||||
assertEquals("2026-06-30T09:10:00Z", projection.route.completedAt)
|
||||
assertTrue(projection.unloadingWeightPending)
|
||||
@@ -174,6 +191,7 @@ class DriverRouteProjectionTest {
|
||||
type: String,
|
||||
status: String,
|
||||
weight: Double,
|
||||
notes: String? = null,
|
||||
occurredAt: String = "2026-06-30T07:40:00Z",
|
||||
createdAt: Long = 1000,
|
||||
): RouteActionEntity =
|
||||
@@ -186,6 +204,7 @@ class DriverRouteProjectionTest {
|
||||
photoClientRequestIdsJson = "[]",
|
||||
status = status,
|
||||
createdAtEpochMillis = createdAt,
|
||||
notes = notes,
|
||||
)
|
||||
|
||||
private companion object {
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package pl.firmatpp.kierowca.ui
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
|
||||
class LiveVoiceDictationTest {
|
||||
@Test
|
||||
fun recognizedTextIsAppendedToExistingTypedNote() {
|
||||
assertEquals(
|
||||
"Oczekiwanie na dokumenty kierowca odebrał WZ",
|
||||
mergeDictationText("Oczekiwanie na dokumenty ", " kierowca odebrał WZ "),
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun recognizedTextCanStartAnEmptyNote() {
|
||||
assertEquals(
|
||||
"Uszkodzona plomba",
|
||||
mergeDictationText("", " Uszkodzona plomba "),
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun routeNotesAreLimitedToApiMaximum() {
|
||||
assertEquals(
|
||||
routeStageNotesMaxLength,
|
||||
normalizeRouteStageNotes("a".repeat(routeStageNotesMaxLength + 20)).length,
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user