feat: 增加门店身份注销流程

This commit is contained in:
2026-08-31 09:43:14 +08:00
parent 396597a160
commit e529bb5942
35 changed files with 6062 additions and 45 deletions
@@ -3,11 +3,29 @@
// suixinkanTests
//
import UIKit
import XCTest
@testable import suixinkan
/// 设置中心 ViewModel 测试。
final class SettingViewModelTests: XCTestCase {
/// 注销入口标题使用危险操作红色,普通菜单和右侧文字保持原色。
@MainActor
func testDeregistrationMenuTitleUsesRedWithoutChangingOtherMenuColors() throws {
let row = SettingMenuRow(title: "注销当前门店身份", titleColor: AppColor.danger, value: "查看", showsDivider: false)
let normalRow = SettingMenuRow(title: "关于我们")
let title = try XCTUnwrap(row.subviews.compactMap { $0 as? UILabel }.first)
let normalTitle = try XCTUnwrap(normalRow.subviews.compactMap { $0 as? UILabel }.first)
let rightStack = try XCTUnwrap(row.subviews.compactMap { $0 as? UIStackView }.first)
let value = try XCTUnwrap(rightStack.arrangedSubviews.compactMap { $0 as? UILabel }.first)
XCTAssertEqual(title.textColor, AppColor.danger)
XCTAssertEqual(normalTitle.textColor, UIColor(hex: 0x4B5563))
XCTAssertEqual(value.textColor, AppColor.textPrimary)
row.isHighlighted = true
XCTAssertEqual(title.textColor, AppColor.danger)
}
func testAppVersionUsesClientInfoFormatting() {
let viewModel = SettingViewModel(
infoDictionary: [