also looking at this
test(ios): cover solid navigation bar title modes
#361
3 files
+22
-1
| @@ -595,7 +595,9 @@ final class NativeLayoutUnitTests: XCTestCase { | ||
| 595 | 595 | navigation.loadViewIfNeeded() |
| 596 | 596 | controller.loadViewIfNeeded() |
| 597 | 597 | |
| 598 | controller.evaluateScript("craft.navigation.setOptions({ backgroundColor: '#123456', navigationBarSolid: true })") | |
| 598 | controller.evaluateScript("craft.navigation.setOptions({ title: 'Solid', largeTitle: true, backgroundColor: '#123456', navigationBarSolid: true })") | |
| 599 | XCTAssertEqual(controller.navigationItem.largeTitleDisplayMode, .always) | |
| 600 | XCTAssertTrue(navigation.navigationBar.prefersLargeTitles) | |
| 599 | 601 | let solid = try XCTUnwrap(controller.navigationItem.standardAppearance) |
| 600 | 602 | XCTAssertNil(solid.backgroundEffect) |
| 601 | 603 | // UIKit may normalize clear to nil; both mean no shadow. |
| @@ -606,6 +608,13 @@ final class NativeLayoutUnitTests: XCTestCase { | ||
| 606 | 608 | XCTAssertNotNil(controller.navigationItem.compactAppearance) |
| 607 | 609 | XCTAssertNotNil(controller.navigationItem.compactScrollEdgeAppearance) |
| 608 | 610 | |
| 611 | // The same fill remains attached when a screen opts out of the large | |
| 612 | // title layout; UIKit must not fall back to its translucent scroll-edge | |
| 613 | // material just because the title collapsed. | |
| 614 | controller.evaluateScript("craft.navigation.setOptions({ largeTitle: false })") | |
| 615 | XCTAssertEqual(controller.navigationItem.largeTitleDisplayMode, .never) | |
| 616 | XCTAssertNotNil(controller.navigationItem.scrollEdgeAppearance) | |
| 617 | ||
| 609 | 618 | controller.evaluateScript("craft.navigation.setOptions({ navigationBarSolid: false })") |
| 610 | 619 | XCTAssertNil(controller.navigationItem.standardAppearance) |
| 611 | 620 | XCTAssertNil(controller.navigationItem.scrollEdgeAppearance) |