//
//  AppResumeTests.swift
//  Tests iOS
//
//  TC-153: App resumes correctly from background.
//

import XCTest

final class AppResumeTests: BaseUITestCase {
    override var seedFixture: String? { "week_of_moods" }

    /// TC-153: Force quit and relaunch — app resumes with data intact.
    func testAppResumes_FromBackground() {
        // Verify initial state
        let tabBar = TabBarScreen(app: app)
        tabBar.assertTabBarVisible()
        assertDayContentVisible()

        captureScreenshot(name: "before_background")

        // Relaunch preserving state (simulates background + foreground)
        relaunchPreservingState()

        // Tab bar should be visible again
        let freshTabBar = TabBarScreen(app: app)
        freshTabBar.assertTabBarVisible()

        // Day content should still be visible (data persisted)
        assertDayContentVisible()

        captureScreenshot(name: "after_resume")
    }
}
