//
//  YearViewHeatmapTests.swift
//  Tests iOS
//
//  TC-148: Year View heatmap grid renders with data.
//

import XCTest

final class YearViewHeatmapTests: BaseUITestCase {
    override var seedFixture: String? { "week_of_moods" }
    override var bypassSubscription: Bool { true }

    /// TC-148: Year View heatmap grid is visible and rendered.
    func testYearView_HeatmapRendered() {
        let tabBar = TabBarScreen(app: app)
        tabBar.tapYear()

        XCTAssertTrue(tabBar.yearTab.isSelected, "Year tab should be selected")

        // Heatmap grid should be visible
        let heatmap = app.element(UITestID.Year.heatmap)
        XCTAssertTrue(
            heatmap.waitForExistence(timeout: 8),
            "Year View heatmap grid should be visible with data"
        )

        // Stats section should also be visible (has data)
        let statsSection = app.element(UITestID.Year.statsSection)
        XCTAssertTrue(
            statsSection.waitForExistence(timeout: 5),
            "Year stats section should be visible"
        )

        captureScreenshot(name: "year_heatmap_rendered")
    }
}
