// // YearViewDisplayTests.swift // Tests iOS // // Year View display tests: stats section with donut chart and 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 the stats section containing the donut chart. func testYearView_DonutChartVisible() { let tabBar = TabBarScreen(app: app) tabBar.tapYear() let statsSection = app.element(UITestID.Year.statsSection) statsSection.waitForExistenceOrFail( timeout: navigationTimeout, message: "Year stats section should be visible" ) // The donut chart center shows "days" let daysLabel = app.staticTexts["days"] daysLabel.waitForExistenceOrFail( timeout: defaultTimeout, message: "Donut chart should display 'days' label in center" ) captureScreenshot(name: "year_donut_chart") } /// TC-036: Year View shows bar chart with mood percentages. func testYearView_BarChartVisible() { let tabBar = TabBarScreen(app: app) tabBar.tapYear() let statsSection = app.element(UITestID.Year.statsSection) statsSection.waitForExistenceOrFail( timeout: navigationTimeout, message: "Year stats section should be visible" ) // week_of_moods fixture: 2 great, 2 good, 1 avg, 1 bad, 1 horrible // Expected percentages: 28% or 14% let found28 = app.staticTexts["28%"].waitForExistence(timeout: defaultTimeout) let found14 = app.staticTexts["14%"].waitForExistence(timeout: defaultTimeout) XCTAssertTrue( found28 || found14, "Bar chart should show at least one percentage value (28% or 14%)" ) captureScreenshot(name: "year_bar_chart") } }