Files
Reflect/Tests iOS/HeaderMoodLoggingTests.swift
Trey t 224341fd98 Fix remaining 17 UI test failures: group defaults, identifiers, hittability, date format
- resetAppState: use correct suite name to clear group defaults (fixes stale subscription state)
- Reorder configureIfNeeded: set expireTrial before IAPManager init
- Add browse_themes_button identifier to CustomizeView Browse Themes button
- Add mood_button_* identifiers to Entry Detail mood grid in NoteEditorView
- Use coordinate-based tap throughout all test screens (iOS 26 Liquid Glass hittability)
- Fix HeaderMoodLogging date format: M/d/yyyy → yyyy/MM/dd to match entry_row identifiers
- AppLaunchTests: wait for isSelected state with NSPredicate instead of immediate check
- OnboardingTests: add waits between swipes and retry logic for skip button

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 16:46:18 -06:00

36 lines
1.0 KiB
Swift

//
// HeaderMoodLoggingTests.swift
// Tests iOS
//
// Header quick-entry mood logging tests.
//
import XCTest
final class HeaderMoodLoggingTests: BaseUITestCase {
override var seedFixture: String? { "empty" }
/// TC-002: Log a mood from the header quick-entry and verify an entry row appears.
func testLogMood_FromHeader_CreatesEntry() {
let dayScreen = DayScreen(app: app)
// 1. Verify mood header is visible (empty state shows the voting header)
dayScreen.assertMoodHeaderVisible()
// 2. Tap "Good" mood button on the header
dayScreen.logMood(.good)
// 3. The header should disappear after the celebration animation
dayScreen.assertMoodHeaderHidden()
// 4. Verify an entry row appeared for today's date
let formatter = DateFormatter()
formatter.dateFormat = "yyyy/MM/dd"
let todayString = formatter.string(from: Date())
dayScreen.assertEntryExists(dateString: todayString)
captureScreenshot(name: "header_mood_logged_good")
}
}