// // InsightsCollapseTests.swift // Tests iOS // // TC-046: Collapse/expand insight sections. // import XCTest final class InsightsCollapseTests: BaseUITestCase { override var seedFixture: String? { "week_of_moods" } override var bypassSubscription: Bool { true } /// TC-046: Tapping the month section header collapses it. func testInsights_CollapseMonthSection() { let tabBar = TabBarScreen(app: app) tabBar.tapInsights() let header = app.element(UITestID.Insights.header) header.waitForExistenceOrFail( timeout: navigationTimeout, message: "Insights header should be visible" ) // Tap the month section to collapse it let monthSection = app.element(UITestID.Insights.monthSection) monthSection.waitUntilHittableOrFail( timeout: navigationTimeout, message: "Month section should be hittable" ) monthSection.forceTap() captureScreenshot(name: "insights_month_collapsed") } /// TC-046b: Tapping the year section header collapses it. func testInsights_CollapseYearSection() { let tabBar = TabBarScreen(app: app) tabBar.tapInsights() let header = app.element(UITestID.Insights.header) header.waitForExistenceOrFail( timeout: navigationTimeout, message: "Insights header should be visible" ) let yearSection = app.element(UITestID.Insights.yearSection) yearSection.scrollIntoView(in: app) yearSection.forceTap() captureScreenshot(name: "insights_year_collapsed") } }