fix: 优化点位展示、选择滚动和收款信息
This commit is contained in:
@@ -5,6 +5,28 @@ import XCTest
|
||||
/// 使用隔离窗口和网络、上传替身验证共用云端交付页。
|
||||
@MainActor
|
||||
final class DroneDockDeliveryViewTests: XCTestCase {
|
||||
/// 云端点位最多 200 点宽,长名称完整换行且仍可选择到对应任务。
|
||||
func testLongPointNamesWrapWithinMaximumCardWidth() async throws {
|
||||
let fixture = try DeliveryUIFixture()
|
||||
let name = "测试景区东南观景平台通往山顶步道的全景航拍游客打卡点"
|
||||
fixture.service.pointNames[0] = name
|
||||
let controller = fixture.controller()
|
||||
let window = show(controller)
|
||||
defer { close(window) }
|
||||
try await settle(window) { controller.viewModel.detail != nil && !controller.viewModel.isLoading }
|
||||
let list = try collection(controller)
|
||||
let point = try XCTUnwrap(find(controller.view, "drone.delivery.point.201") as? UICollectionViewCell)
|
||||
let label = try XCTUnwrap(point.contentView.subviews.first as? UILabel)
|
||||
XCTAssertEqual(label.text, name)
|
||||
XCTAssertEqual(label.numberOfLines, 0)
|
||||
XCTAssertLessThanOrEqual(point.bounds.width, 200)
|
||||
XCTAssertGreaterThan(point.bounds.height, 40)
|
||||
XCTAssertGreaterThanOrEqual(label.bounds.height + 1,
|
||||
label.sizeThatFits(CGSize(width: label.bounds.width, height: .greatestFiniteMagnitude)).height)
|
||||
try select("drone.delivery.point.201", list: list)
|
||||
try await settle(window) { controller.viewModel.selectedSpotID == 201 }
|
||||
capture(window, "云端交付-长点位限定宽度完整换行")
|
||||
}
|
||||
private weak var previousKeyWindow: UIWindow?
|
||||
|
||||
/// 弹窗关闭与普通返回共享处理中确认,取消提示不会结束正在进行的上传。
|
||||
@@ -347,6 +369,7 @@ private final class DeliveryUIFixture {
|
||||
/// 可暂停保存以验证 OSS 成功和业务交付成功的展示边界。
|
||||
@MainActor
|
||||
private final class DeliveryUIService: DroneDockDeliveryServing {
|
||||
var pointNames = ["测试点位一", "测试点位二"]
|
||||
var failDetail = false
|
||||
var failSaveCount = 0
|
||||
var holdSave = false
|
||||
@@ -369,7 +392,7 @@ private final class DeliveryUIService: DroneDockDeliveryServing {
|
||||
if failDetail { throw URLError(.notConnectedToInternet) }
|
||||
return try deliveryDecode(["order_number": "TEST-DELIVERY-UI", "user_phone": "130****0001", "project_name": "测试航拍套餐",
|
||||
"order_status": 20, "can_upload_film": allowed, "shoot_count": 5, "shot_count": 2, "remaining_count": 3,
|
||||
"spot": [["scenic_spot_id": 201, "scenic_spot_name": "测试点位一"], ["scenic_spot_id": 202, "scenic_spot_name": "测试点位二"]]])
|
||||
"spot": [["scenic_spot_id": 201, "scenic_spot_name": pointNames[0]], ["scenic_spot_id": 202, "scenic_spot_name": pointNames[1]]]])
|
||||
}
|
||||
func tasks(scenicID: Int, orderNumber: String, spotID: Int?) async throws -> DroneDockMaterialTasks {
|
||||
try deliveryDecode(["order_number": "TEST-DELIVERY-UI", "total": records.count, "list": records])
|
||||
|
||||
Reference in New Issue
Block a user