//
//  MainTabUITests.swift
//  suixinkanUITests
//

import XCTest

final class MainTabUITests: AuthenticatedUITestCase {
    /// 测试四个主 Tab 均可切换且展示核心标题。
    func testAllMainTabsAreReachable() {
        TabBarNavigator.select(.home, app: app)
        XCTAssertTrue(
            app.application.staticTexts["常用应用"].waitForExistence(timeout: 8)
                || app.application.staticTexts["请选择景区"].exists
        )

        TabBarNavigator.select(.orders, app: app)
        XCTAssertTrue(
            NavigationAssertions.waitForAnyNavigationTitle(["订单"], in: app, timeout: 15) != nil
                || app.application.staticTexts["订单管理"].waitForExistence(timeout: 15)
        )

        TabBarNavigator.select(.statistics, app: app)
        _ = NavigationAssertions.waitForAnyNavigationTitle(["数据"], in: app, timeout: 15)

        TabBarNavigator.select(.profile, app: app)
        NavigationAssertions.waitForStaticText("系统设置", in: app, timeout: 12)
    }
}
