Files
Reflect/Tests iOS/EntryDetailTests.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

63 lines
1.7 KiB
Swift

//
// EntryDetailTests.swift
// Tests iOS
//
// Entry detail sheet open/dismiss and mood change tests.
//
import XCTest
final class EntryDetailTests: BaseUITestCase {
override var seedFixture: String? { "week_of_moods" }
/// Tap an entry row -> Entry Detail sheet opens -> dismiss it.
func testTapEntry_OpensDetailSheet_Dismiss() {
// Find the first entry row by identifier prefix
let firstEntry = app.descendants(matching: .any)
.matching(NSPredicate(format: "identifier BEGINSWITH %@", "entry_row_"))
.firstMatch
guard firstEntry.waitForExistence(timeout: 5) else {
XCTFail("No entry rows found in seeded data")
return
}
firstEntry.tap()
let detailScreen = EntryDetailScreen(app: app)
detailScreen.assertVisible()
captureScreenshot(name: "entry_detail_open")
// Dismiss the sheet
detailScreen.dismiss()
detailScreen.assertDismissed()
}
/// Open entry detail and change mood, then dismiss.
func testChangeMood_ViaEntryDetail() {
let firstEntry = app.descendants(matching: .any)
.matching(NSPredicate(format: "identifier BEGINSWITH %@", "entry_row_"))
.firstMatch
guard firstEntry.waitForExistence(timeout: 5) else {
XCTFail("No entry rows found in seeded data")
return
}
firstEntry.tap()
let detailScreen = EntryDetailScreen(app: app)
detailScreen.assertVisible()
// Select a different mood (Bad)
detailScreen.selectMood(.bad)
captureScreenshot(name: "mood_changed_to_bad")
// Dismiss
detailScreen.dismiss()
detailScreen.assertDismissed()
}
}