- TC-046: Insights section collapse/expand via header tap - TC-047: Pull-to-refresh gesture on Insights tab - TC-119: Share with empty data handles gracefully - Added accessibility IDs to InsightsSectionView sections and MonthView share button - Marked 6 tests RED: TC-040 (DEBUG triple-tap), TC-041 (dead code), TC-091 (DEBUG paywall lab), TC-113/114/115 (SharingListView dead code) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
59 lines
1.9 KiB
Swift
59 lines
1.9 KiB
Swift
//
|
|
// 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 a section header collapses/expands that section.
|
|
func testInsights_CollapseExpandSections() {
|
|
let tabBar = TabBarScreen(app: app)
|
|
tabBar.tapInsights()
|
|
|
|
// Verify Insights header loads
|
|
let header = app.element(UITestID.Insights.header)
|
|
XCTAssertTrue(
|
|
header.waitForExistence(timeout: 8),
|
|
"Insights header should be visible"
|
|
)
|
|
|
|
captureScreenshot(name: "insights_initial")
|
|
|
|
// Find the "This Month" section header text and tap to collapse
|
|
// Note: the text is inside a Button, so we use coordinate tap fallback
|
|
let monthTitle = app.staticTexts["This Month"].firstMatch
|
|
XCTAssertTrue(
|
|
monthTitle.waitForExistence(timeout: 5),
|
|
"This Month section title should exist"
|
|
)
|
|
|
|
monthTitle.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5)).tap()
|
|
|
|
// Brief wait for animation
|
|
_ = app.waitForExistence(timeout: 1)
|
|
|
|
captureScreenshot(name: "insights_month_collapsed")
|
|
|
|
// Tap again to expand
|
|
monthTitle.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5)).tap()
|
|
|
|
_ = app.waitForExistence(timeout: 1)
|
|
|
|
captureScreenshot(name: "insights_month_expanded")
|
|
|
|
// Also test "This Year" section
|
|
let yearTitle = app.staticTexts["This Year"].firstMatch
|
|
if yearTitle.waitForExistence(timeout: 3) {
|
|
yearTitle.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5)).tap()
|
|
_ = app.waitForExistence(timeout: 1)
|
|
captureScreenshot(name: "insights_year_collapsed")
|
|
}
|
|
}
|
|
}
|