// // YearViewDisplayTests.swift // Tests iOS // // Year View display tests: donut chart, bar chart. // TC-035, TC-036 // import XCTest final class YearViewDisplayTests: BaseUITestCase { override var seedFixture: String? { "week_of_moods" } override var bypassSubscription: Bool { true } /// TC-035: Year View shows donut chart with mood distribution. func testYearView_DonutChartVisible() { let tabBar = TabBarScreen(app: app) tabBar.tapYear() // Wait for Year tab to be selected and content to load XCTAssertTrue(tabBar.yearTab.isSelected, "Year tab should be selected") captureScreenshot(name: "year_view_loaded") // The donut chart is inside the stats section of the first YearCard. // Try finding by accessibility identifier first, then fall back to presence of "days" text. let donutChart = app.element(UITestID.Year.donutChart) let found = donutChart.waitForExistence(timeout: 8) || app.swipeUntilExists(donutChart, direction: .up, maxSwipes: 3, timeoutPerTry: 1.0) captureScreenshot(name: "year_donut_chart") XCTAssertTrue(found, "Donut chart should be visible in Year View") } /// TC-036: Year View shows bar chart with mood percentages. func testYearView_BarChartVisible() { let tabBar = TabBarScreen(app: app) tabBar.tapYear() XCTAssertTrue(tabBar.yearTab.isSelected, "Year tab should be selected") let barChart = app.element(UITestID.Year.barChart) let found = barChart.waitForExistence(timeout: 8) || app.swipeUntilExists(barChart, direction: .up, maxSwipes: 3, timeoutPerTry: 1.0) captureScreenshot(name: "year_bar_chart") XCTAssertTrue(found, "Bar chart should be visible in Year View") } }