Add 5 passing UI tests (batches 1-2) and mark 4 blocked tests RED

Batch 1: TC-035 (donut chart), TC-036 (bar chart) — Year View stats
Batch 2: TC-037 (collapse/expand), TC-065 (privacy link), TC-066 (EULA link)
Blocked: TC-124, TC-068 (Settings ScrollView tap issue), TC-038 (share sheet)

New accessibility IDs: bypass subscription toggle, EULA, privacy policy buttons.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-02-20 10:02:17 -06:00
parent 5895b387be
commit 599e54aa72
9 changed files with 162 additions and 66 deletions

View File

@@ -0,0 +1,60 @@
//
// YearViewCollapseTests.swift
// Tests iOS
//
// TC-037: Collapse/expand year stats section.
//
import XCTest
final class YearViewCollapseTests: BaseUITestCase {
override var seedFixture: String? { "week_of_moods" }
override var bypassSubscription: Bool { true }
/// TC-037: Tapping the year card header collapses and re-expands stats.
func testYearView_CollapseExpand_StatsSection() {
let tabBar = TabBarScreen(app: app)
tabBar.tapYear()
XCTAssertTrue(tabBar.yearTab.isSelected, "Year tab should be selected")
// Stats section is visible by default (showStats = true)
let statsSection = app.element(UITestID.Year.statsSection)
XCTAssertTrue(
statsSection.waitForExistence(timeout: 8),
"Year stats section should be visible initially"
)
// Find the current year's card header button
let currentYear = Calendar.current.component(.year, from: Date())
let headerButton = app.element(UITestID.Year.cardHeader(year: currentYear))
XCTAssertTrue(
headerButton.waitForExistence(timeout: 5),
"Year card header for \(currentYear) should be visible"
)
captureScreenshot(name: "year_stats_expanded")
// Tap header to collapse stats
headerButton.tap()
// Stats section should disappear
XCTAssertTrue(
statsSection.waitForDisappearance(timeout: 3),
"Stats section should collapse after tapping header"
)
captureScreenshot(name: "year_stats_collapsed")
// Tap header again to expand stats
headerButton.tap()
// Stats section should reappear
XCTAssertTrue(
statsSection.waitForExistence(timeout: 3),
"Stats section should expand after tapping header again"
)
captureScreenshot(name: "year_stats_re_expanded")
}
}