| 1 |
import SwiftUI |
|
| 2 |
import XCTest |
|
| 3 |
@testable import HealthProbe |
|
| 4 | ||
| 5 |
final class LegacyUIModeTests: XCTestCase {
|
|
| 6 |
func testForcedSimplifiedModeWins() {
|
|
| 7 |
XCTAssertTrue(LegacyUIMode.isEnabled( |
|
| 8 |
forceEnabled: true, |
|
| 9 |
horizontalSizeClass: .regular, |
|
| 10 |
dynamicTypeSize: .large, |
|
| 11 |
screenWidth: 744 |
|
| 12 |
)) |
|
| 13 |
} |
|
| 14 | ||
| 15 |
func testCompactSmallScreenUsesSimplifiedMode() {
|
|
| 16 |
XCTAssertTrue(LegacyUIMode.isEnabled( |
|
| 17 |
forceEnabled: false, |
|
| 18 |
horizontalSizeClass: .compact, |
|
| 19 |
dynamicTypeSize: .large, |
|
| 20 |
screenWidth: 375 |
|
| 21 |
)) |
|
| 22 |
} |
|
| 23 | ||
| 24 |
func testAccessibilityDynamicTypeUsesSimplifiedMode() {
|
|
| 25 |
XCTAssertTrue(LegacyUIMode.isEnabled( |
|
| 26 |
forceEnabled: false, |
|
| 27 |
horizontalSizeClass: .regular, |
|
| 28 |
dynamicTypeSize: .accessibility1, |
|
| 29 |
screenWidth: 744 |
|
| 30 |
)) |
|
| 31 |
} |
|
| 32 | ||
| 33 |
func testRegularComfortableLayoutKeepsFullMode() {
|
|
| 34 |
XCTAssertFalse(LegacyUIMode.isEnabled( |
|
| 35 |
forceEnabled: false, |
|
| 36 |
horizontalSizeClass: .regular, |
|
| 37 |
dynamicTypeSize: .large, |
|
| 38 |
screenWidth: 744 |
|
| 39 |
)) |
|
| 40 |
} |
|
| 41 |
} |