also looking at this
feat: finish native customization and platform seams
#401
21 files
+707
-17
| @@ -17,6 +17,24 @@ final class NativeLayoutUnitTests: XCTestCase { | ||
| 17 | 17 | return controller |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | func testNativeScreenUsesConfiguredUIKitAppearance() { | |
| 21 | var config = CraftConfig() | |
| 22 | config.appearance = "light" | |
| 23 | let light = CraftNativeScreenController(config: config) | |
| 24 | light.loadViewIfNeeded() | |
| 25 | XCTAssertEqual(light.overrideUserInterfaceStyle, .light) | |
| 26 | ||
| 27 | config.appearance = "dark" | |
| 28 | let dark = CraftNativeScreenController(config: config) | |
| 29 | dark.loadViewIfNeeded() | |
| 30 | XCTAssertEqual(dark.overrideUserInterfaceStyle, .dark) | |
| 31 | ||
| 32 | config.appearance = "system" | |
| 33 | let system = CraftNativeScreenController(config: config) | |
| 34 | system.loadViewIfNeeded() | |
| 35 | XCTAssertEqual(system.overrideUserInterfaceStyle, .unspecified) | |
| 36 | } | |
| 37 | ||
| 20 | 38 | func testReturningToAnUnchangedThemeRetainsTextAndScrollGeometry() throws { |
| 21 | 39 | let rows: [[String: Any]] = (0..<100).map { index in |
| 22 | 40 | ["id": "row-\(index)", "type": "Text", "props": ["testID": "row-\(index)"], |