Schedules on a computer: which one, its folder and mode, and "not linked now"
CI / check (push) Canceled after 0s
CI / check (push) Canceled after 0s
`runs_on` (server 57d06ee): the schedule page says Computer: name · folder · mode; each run row names the computer, and a run waiting with error class device_away adds "not linked now" (server's words). The fixtures carry no "does not accept scheduled work" state on /api/v2, so that one is the run's own error text only. ScheduleContractTest reads schedule_on_device.json; shot 10-schedule-on-computer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
16 files changed
+141
-2
No files matched your search
@@ -12,6 +12,7 @@ import eu.llembas.android.api.ScheduleList
|
||||
import eu.llembas.android.api.ScheduleRuns
|
||||
import eu.llembas.android.api.SchedulesFrame
|
||||
import eu.llembas.android.api.SchedulingModels
|
||||
import eu.llembas.android.api.computerAway
|
||||
import eu.llembas.android.push.ScheduledNotice
|
||||
import eu.llembas.android.ui.scheduled.ScheduleLogic
|
||||
import eu.llembas.android.ui.scheduled.SchedulingLogic
|
||||
@@ -106,6 +107,20 @@ class ScheduleContractTest {
|
||||
assertNull(read("schedule", ScheduleEnvelope.serializer()).schedule.watch)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun aScheduleOnAComputerAndARunThatFoundItAway() {
|
||||
val on = read("schedule_on_device", ScheduleEnvelope.serializer()).schedule
|
||||
val where = on.runsOn!!
|
||||
assertEquals("bag-end", where.deviceName)
|
||||
assertEquals("/home/frodo/waybread", where.cwd)
|
||||
assertEquals("edit", where.mode)
|
||||
assertEquals(30, where.approvalWaitMinutes)
|
||||
val run = on.lastRun!!
|
||||
assertEquals("device", run.waitingFor)
|
||||
assertTrue(run.computerAway)
|
||||
assertNull(read("schedule", ScheduleEnvelope.serializer()).schedule.runsOn)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun theRunsAWaitingOneAndOneInFull() {
|
||||
val page = read("schedule_runs", ScheduleRuns.serializer())
|
||||
|
||||
@@ -25,6 +25,7 @@ import eu.llembas.android.api.RunResult
|
||||
import eu.llembas.android.api.RunTokens
|
||||
import eu.llembas.android.api.Schedule
|
||||
import eu.llembas.android.api.ScheduleCompiled
|
||||
import eu.llembas.android.api.ScheduleEnvelope
|
||||
import eu.llembas.android.api.ScheduleRun
|
||||
import eu.llembas.android.api.SchedulingModel
|
||||
import eu.llembas.android.api.SchedulingModels
|
||||
@@ -510,6 +511,10 @@ object Fakes {
|
||||
preview = "Little happened over the weekend: one grid-storage tender in Austria.",
|
||||
)
|
||||
|
||||
private val onComputer = LembasJson.decodeFromString(ScheduleEnvelope.serializer(), text("schedule_on_device")).schedule
|
||||
|
||||
val scheduleOnComputer = ScheduleState(schedule = onComputer, runs = listOfNotNull(onComputer.lastRun))
|
||||
|
||||
val schedule = ScheduleState(
|
||||
schedule = schedules[0],
|
||||
runs = listOf(
|
||||
|
||||
@@ -184,6 +184,13 @@ class ScreenShots {
|
||||
@Test
|
||||
fun schedule() = shoot("10-schedule") { ScheduleContent(Fakes.schedule) }
|
||||
|
||||
@Test
|
||||
fun scheduleOnAComputer() {
|
||||
// The server's own fixture: on bag-end, in a folder, Edit, and the computer away.
|
||||
shoot("10-schedule-on-computer") { ScheduleContent(Fakes.scheduleOnComputer) }
|
||||
shoot("10-schedule-on-computer", Phone.Small, fontScale = 1.5f) { ScheduleContent(Fakes.scheduleOnComputer) }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun scheduleEdit() = shoot("11-schedule-edit") { ScheduleEditContent(Fakes.editing, editing = false) }
|
||||
|
||||
|
||||
Reference in new issue
Block a user