适配上传中订单并完善机巢操作与订阅兜底
支持订单状态 25 和持续拍摄、交付确认;安全指令点击后直接提交;鉴权超时保留 HTTP 兜底并退避换票重连。补充对应隔离回归测试。
This commit is contained in:
@@ -77,6 +77,21 @@ final class DroneDockDeliveryViewModelTests: XCTestCase {
|
||||
XCTAssertFalse(fixture.model.canSubmit)
|
||||
}
|
||||
|
||||
/// 整单上传中仍可交付成片,但不能把状态 25 本身当作上传许可。
|
||||
func testUploadingOrderDeliveryRequiresExplicitPermission() async throws {
|
||||
for allowed in [false, true] {
|
||||
let fixture = try DeliveryVMFixture(initialTaskID: 11)
|
||||
fixture.service.detailValue = try DeliveryVMData.detail(allowed: allowed, status: 25)
|
||||
await fixture.prepare()
|
||||
XCTAssertEqual(fixture.model.canChooseVideo, allowed)
|
||||
XCTAssertEqual(fixture.model.canSubmit, allowed)
|
||||
await fixture.model.submit()
|
||||
XCTAssertEqual(fixture.uploader.calls, allowed ? 1 : 0)
|
||||
XCTAssertEqual(fixture.service.saves.count, allowed ? 1 : 0)
|
||||
if allowed { XCTAssertEqual(fixture.model.phase, .succeeded) }
|
||||
}
|
||||
}
|
||||
|
||||
/// 无上传权限、已取消、已退款和不支持的视频均不发送写请求。
|
||||
func testPermissionAndVideoValidationDisableSubmission() async throws {
|
||||
for (allowed, status) in [(false, 20), (true, 10), (true, 40), (true, 50)] {
|
||||
|
||||
Reference in New Issue
Block a user