fix(mobile): align profile routing, catalog timeout and replay cancellation
This commit is contained in:
1 parent
827c74b3c3
commit
cb7e6acb59
21 files changed
+297
-13
No files matched your search
@@ -555,4 +555,30 @@ class CronJobsViewModelTest {
|
||||
assertEquals("gateway unreachable", job.last_fire_error?.detail)
|
||||
assertEquals("2026-08-18T09:00:00", job.last_fire_error?.at)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `lost create response does not create duplicate scheduled jobs`() {
|
||||
val vm = createViewModel()
|
||||
vm.openNewJobDialog()
|
||||
settle()
|
||||
vm.updateEditorField("name", "Retry safety")
|
||||
vm.updateEditorField("schedule", "every 1d")
|
||||
coEvery { mockApi.createCronJob(any()) } throws java.net.SocketTimeoutException("reply lost")
|
||||
vm.saveEditor()
|
||||
settle()
|
||||
coVerify(exactly = 1) { mockApi.createCronJob(any()) }
|
||||
assertTrue(vm.uiState.value.editorState.isOpen)
|
||||
assertFalse(vm.uiState.value.editorState.isSaving)
|
||||
assertNotNull(vm.uiState.value.editorState.toastMessage)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `lost trigger response does not run a scheduled job twice`() {
|
||||
val vm = createViewModel()
|
||||
coEvery { mockApi.triggerCronJob("j-test") } throws java.net.SocketTimeoutException("reply lost")
|
||||
vm.triggerCronJob("j-test")
|
||||
settle()
|
||||
coVerify(exactly = 1) { mockApi.triggerCronJob("j-test") }
|
||||
assertNotNull(vm.uiState.value.toastMessage)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user