//
//  LocalizationTests.swift
//  Tests iOS
//
//  TC-136: English strings display correctly.
//

import XCTest

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

    /// TC-136: Key English strings are present and not showing localization keys.
    func testEnglishStrings_DisplayCorrectly() {
        // Day tab should show English content
        assertDayContentVisible()

        // Tab bar should contain English labels
        let tabBar = app.tabBars.firstMatch
        XCTAssertTrue(tabBar.waitForExistence(timeout: 5), "Tab bar should exist")

        captureScreenshot(name: "localization_day_tab")

        // Navigate to Settings and verify English header
        let tabBarScreen = TabBarScreen(app: app)
        let settingsScreen = tabBarScreen.tapSettings()
        settingsScreen.assertVisible()

        // The settings header with accessibility identifier should exist
        let settingsHeader = app.element(UITestID.Settings.header)
        XCTAssertTrue(
            settingsHeader.waitForExistence(timeout: 5),
            "Settings header should be visible"
        )

        // Verify we see "Settings" text somewhere (not a localization key)
        let settingsText = app.staticTexts.matching(
            NSPredicate(format: "label == %@", "Settings")
        ).firstMatch
        XCTAssertTrue(
            settingsText.waitForExistence(timeout: 3),
            "Settings title should display in English (not localization key)"
        )

        captureScreenshot(name: "localization_settings_english")
    }
}
