import SwiftUI
import XCTest
@testable import HealthProbe

final class LegacyUIModeTests: XCTestCase {
    func testForcedSimplifiedModeWins() {
        XCTAssertTrue(LegacyUIMode.isEnabled(
            forceEnabled: true,
            horizontalSizeClass: .regular,
            dynamicTypeSize: .large,
            screenWidth: 744
        ))
    }

    func testCompactSmallScreenUsesSimplifiedMode() {
        XCTAssertTrue(LegacyUIMode.isEnabled(
            forceEnabled: false,
            horizontalSizeClass: .compact,
            dynamicTypeSize: .large,
            screenWidth: 375
        ))
    }

    func testAccessibilityDynamicTypeUsesSimplifiedMode() {
        XCTAssertTrue(LegacyUIMode.isEnabled(
            forceEnabled: false,
            horizontalSizeClass: .regular,
            dynamicTypeSize: .accessibility1,
            screenWidth: 744
        ))
    }

    func testRegularComfortableLayoutKeepsFullMode() {
        XCTAssertFalse(LegacyUIMode.isEnabled(
            forceEnabled: false,
            horizontalSizeClass: .regular,
            dynamicTypeSize: .large,
            screenWidth: 744
        ))
    }
}
