ReviewOS

also looking at this

craft-native/craft

test(ios): cover solid navigation bar title modes

#361
Closed glennmichael123 wants to merge codex/issue-360-solid-navigation-bar into main
3 files +22 -1
packages/ios/fixtures/native-screen/NativeLayoutUnitTests.swiftmodified+10-1
Changes to packages/ios/fixtures/native-screen/NativeLayoutUnitTests.swift
@@ -595,7 +595,9 @@ final class NativeLayoutUnitTests: XCTestCase {
595595 navigation.loadViewIfNeeded()
596596 controller.loadViewIfNeeded()
597597
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)
599601 let solid = try XCTUnwrap(controller.navigationItem.standardAppearance)
600602 XCTAssertNil(solid.backgroundEffect)
601603 // UIKit may normalize clear to nil; both mean no shadow.
@@ -606,6 +608,13 @@ final class NativeLayoutUnitTests: XCTestCase {
606608 XCTAssertNotNil(controller.navigationItem.compactAppearance)
607609 XCTAssertNotNil(controller.navigationItem.compactScrollEdgeAppearance)
608610
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
609618 controller.evaluateScript("craft.navigation.setOptions({ navigationBarSolid: false })")
610619 XCTAssertNil(controller.navigationItem.standardAppearance)
611620 XCTAssertNil(controller.navigationItem.scrollEdgeAppearance)