feat(drone-dock): 接入素材下载并限制拍满后游客确认
This commit is contained in:
@@ -7,6 +7,26 @@ import XCTest
|
||||
final class DroneDockViewTests: XCTestCase {
|
||||
private weak var previousKeyWindow: UIWindow?
|
||||
|
||||
/// 本地订单演示也仅在成功拍满套餐后显示游客确认,复用回未拍满状态不能保留入口。
|
||||
func testDemoVisitorConfirmationRequiresFullSuccessfulQuota() throws {
|
||||
let card = DroneShootingOrderCardView()
|
||||
var confirmationCount = 0
|
||||
card.onConfirmationTap = { confirmationCount += 1 }
|
||||
for (total, used, visible) in [(5, 4, false), (5, 5, true), (5, 4, false), (0, 0, false)] {
|
||||
let order = DroneShootingOrder(id: "quota", scenicID: "local", assignedUserID: "local",
|
||||
customerName: "本地游客", orderNumber: "TEST-QUOTA", createdAtText: "10-30 10:00",
|
||||
packageName: "测试套餐", totalShootingCount: total, successfulShootingCount: used,
|
||||
activeTask: nil, needsRepreparation: false, materialState: .ready, deliveredVideoCount: 1,
|
||||
visitorConfirmationState: .none)
|
||||
card.apply(order: order)
|
||||
let control = try XCTUnwrap(find(in: card, identifier: "drone.order.quota.confirmation") as? UIControl)
|
||||
XCTAssertEqual(control.isHidden, !visible)
|
||||
XCTAssertEqual(control.isEnabled, visible)
|
||||
control.sendActions(for: .touchUpInside)
|
||||
}
|
||||
XCTAssertEqual(confirmationCount, 1)
|
||||
}
|
||||
|
||||
/// 零次订单仍在返航时,完整订单卡保留当前任务入口,渲染及点击都不改变次数。
|
||||
func testCompletedReturningCardKeepsCurrentTaskActionWithoutChangingQuota() async throws {
|
||||
let order = returningOrder()
|
||||
|
||||
Reference in New Issue
Block a user