Files
Reflect/Tests iOS/MonthViewTests.swift
Trey t 277e277750 Add XCUITest suite with 27 test files covering unmapped P1 test cases
- Add 8 new test files: HeaderMoodLogging (TC-002), DayViewGrouping (TC-019),
  AllDayViewStyles (TC-021), MonthViewInteraction (TC-030), PaywallGate
  (TC-032/039/048), AppTheme (TC-070), IconPack (TC-072),
  PremiumCustomization (TC-075)
- Add accessibility IDs for paywall overlays, icon packs, app theme cards,
  and day view section headers
- Add --expire-trial launch argument to UITestMode for paywall gate testing
- Update QA test plan spreadsheet with XCUITest names for 14 test cases
- Include existing test infrastructure: screen objects, helpers, base class,
  and 19 previously written test files

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 09:37:54 -06:00

50 lines
1.6 KiB
Swift

//
// MonthViewTests.swift
// Tests iOS
//
// Month view navigation and empty-state tests.
//
import XCTest
final class MonthViewTests: BaseUITestCase {
override var seedFixture: String? { "week_of_moods" }
/// TC-030: Navigate to Month view and verify content is visible.
func testMonthView_ContentLoads() {
let tabBar = TabBarScreen(app: app)
tabBar.tapMonth()
XCTAssertTrue(tabBar.monthTab.isSelected, "Month tab should be selected")
// Wait for month view content to load - look for any visible content
// Month cards should have mood color cells or month headers
let monthContent = app.scrollViews.firstMatch
XCTAssertTrue(
monthContent.waitForExistence(timeout: 5),
"Month view should have scrollable content"
)
captureScreenshot(name: "month_view_with_data")
}
}
final class MonthViewEmptyTests: BaseUITestCase {
override var seedFixture: String? { "empty" }
/// TC-031: Navigate to Month view with no data - should not crash.
func testMonthView_EmptyState_NoCrash() {
let tabBar = TabBarScreen(app: app)
tabBar.tapMonth()
XCTAssertTrue(tabBar.monthTab.isSelected, "Month tab should be selected")
// The view should load without crashing, even with no data.
// Give it a moment to render.
let monthTabStillSelected = tabBar.monthTab.waitForExistence(timeout: 3)
XCTAssertTrue(monthTabStillSelected, "App should not crash on empty month view")
captureScreenshot(name: "month_view_empty")
}
}